From 71fa1c3ee3fdd310f04730d4306188001d7e0805 Mon Sep 17 00:00:00 2001 From: jinkun Date: Thu, 16 Jul 2026 14:01:12 +0800 Subject: [PATCH] recipe(segformer): add nvidia b4 ADE recipe coverage --- .../cpu/image-segmentation_fp16_config.json | 60 +++++++++++++++++++ .../cpu/image-segmentation_fp32_config.json | 56 +++++++++++++++++ 2 files changed, 116 insertions(+) create mode 100644 examples/recipes/nvidia_segformer-b4-finetuned-ade-512-512/cpu/cpu/image-segmentation_fp16_config.json create mode 100644 examples/recipes/nvidia_segformer-b4-finetuned-ade-512-512/cpu/cpu/image-segmentation_fp32_config.json diff --git a/examples/recipes/nvidia_segformer-b4-finetuned-ade-512-512/cpu/cpu/image-segmentation_fp16_config.json b/examples/recipes/nvidia_segformer-b4-finetuned-ade-512-512/cpu/cpu/image-segmentation_fp16_config.json new file mode 100644 index 000000000..87fc1db60 --- /dev/null +++ b/examples/recipes/nvidia_segformer-b4-finetuned-ade-512-512/cpu/cpu/image-segmentation_fp16_config.json @@ -0,0 +1,60 @@ +{ + "export": { + "opset_version": 17, + "batch_size": 1, + "export_params": true, + "do_constant_folding": true, + "verbose": false, + "dynamo": false, + "enable_hierarchy_tags": true, + "clean_onnx": false, + "hierarchy_tag_format": "full", + "input_tensors": [ + { + "name": "pixel_values", + "dtype": "float32", + "shape": [ + 1, + 3, + 512, + 512 + ], + "value_range": [ + 0, + 1 + ] + } + ], + "output_tensors": [ + { + "name": "logits" + } + ] + }, + "optim": {}, + "quant": { + "mode": "fp16", + "fp16_keep_io_types": true, + "fp16_op_block_list": null, + "task": "image-segmentation", + "model_id": "nvidia/segformer-b4-finetuned-ade-512-512" + }, + "compile": null, + "loader": { + "task": "image-segmentation", + "model_class": "AutoModelForSemanticSegmentation", + "model_type": "segformer" + }, + "eval": { + "task": "image-segmentation", + "dataset": { + "path": "danjacobellis/scene_parse_150", + "split": "validation", + "samples": 100, + "label_mapping_file": "scripts/e2e_eval/datasets/ade20k_gt_to_model_label.json", + "columns_mapping": { + "annotation_column": "annotation" + } + } + } +} diff --git a/examples/recipes/nvidia_segformer-b4-finetuned-ade-512-512/cpu/cpu/image-segmentation_fp32_config.json b/examples/recipes/nvidia_segformer-b4-finetuned-ade-512-512/cpu/cpu/image-segmentation_fp32_config.json new file mode 100644 index 000000000..87e3a958a --- /dev/null +++ b/examples/recipes/nvidia_segformer-b4-finetuned-ade-512-512/cpu/cpu/image-segmentation_fp32_config.json @@ -0,0 +1,56 @@ +{ + "export": { + "opset_version": 17, + "batch_size": 1, + "export_params": true, + "do_constant_folding": true, + "verbose": false, + "dynamo": false, + "enable_hierarchy_tags": true, + "clean_onnx": false, + "hierarchy_tag_format": "full", + "input_tensors": [ + { + "name": "pixel_values", + "dtype": "float32", + "shape": [ + 1, + 3, + 512, + 512 + ], + "value_range": [ + 0, + 1 + ] + } + ], + "output_tensors": [ + { + "name": "logits" + } + ] + }, + "optim": { + + }, + "quant": null, + "compile": null, + "loader": { + "task": "image-segmentation", + "model_class": "AutoModelForSemanticSegmentation", + "model_type": "segformer" + }, + "eval": { + "task": "image-segmentation", + "dataset": { + "path": "danjacobellis/scene_parse_150", + "split": "validation", + "samples": 100, + "label_mapping_file": "scripts/e2e_eval/datasets/ade20k_gt_to_model_label.json", + "columns_mapping": { + "annotation_column": "annotation" + } + } + } +}