From ac7b2df3c73e528130aa97c467b842282b62de30 Mon Sep 17 00:00:00 2001 From: fuliucansheng Date: Fri, 24 Jul 2026 10:00:47 +0800 Subject: [PATCH] recipe(owlv2-large-patch14): add CPU zero-shot detection configs --- ...ero-shot-object-detection_fp16_config.json | 97 +++++++++++++++++++ ...ero-shot-object-detection_fp32_config.json | 75 ++++++++++++++ 2 files changed, 172 insertions(+) create mode 100644 examples/recipes/google_owlv2-large-patch14/cpu/cpu/zero-shot-object-detection_fp16_config.json create mode 100644 examples/recipes/google_owlv2-large-patch14/cpu/cpu/zero-shot-object-detection_fp32_config.json diff --git a/examples/recipes/google_owlv2-large-patch14/cpu/cpu/zero-shot-object-detection_fp16_config.json b/examples/recipes/google_owlv2-large-patch14/cpu/cpu/zero-shot-object-detection_fp16_config.json new file mode 100644 index 000000000..36779438e --- /dev/null +++ b/examples/recipes/google_owlv2-large-patch14/cpu/cpu/zero-shot-object-detection_fp16_config.json @@ -0,0 +1,97 @@ +{ + "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": "input_ids", + "dtype": "int32", + "shape": [ + 1, + 16 + ], + "value_range": [ + 0, + 49408 + ] + }, + { + "name": "pixel_values", + "dtype": "float32", + "shape": [ + 1, + 3, + 1008, + 1008 + ], + "value_range": [ + 0, + 1 + ] + }, + { + "name": "attention_mask", + "dtype": "int32", + "shape": [ + 1, + 16 + ], + "value_range": [ + 0, + 2 + ] + } + ], + "output_tensors": [ + { + "name": "logits" + }, + { + "name": "pred_boxes" + }, + { + "name": "text_embeds" + }, + { + "name": "image_embeds" + } + ] + }, + "optim": {}, + "quant": { + "mode": "fp16", + "samples": 10, + "calibration_method": "minmax", + "weight_type": "uint8", + "activation_type": "uint8", + "per_channel": false, + "symmetric": false, + "weight_symmetric": null, + "activation_symmetric": null, + "save_calibration": false, + "distribution": "uniform", + "seed": null, + "calibration_load_path": null, + "calibration_save_path": null, + "op_types_to_quantize": null, + "nodes_to_exclude": null, + "task": "zero-shot-object-detection", + "model_id": "google/owlv2-large-patch14", + "model_type": "owlv2", + "fp16_keep_io_types": true, + "fp16_op_block_list": null + }, + "compile": null, + "loader": { + "task": "zero-shot-object-detection", + "model_class": "AutoModelForZeroShotObjectDetection", + "model_type": "owlv2" + } +} diff --git a/examples/recipes/google_owlv2-large-patch14/cpu/cpu/zero-shot-object-detection_fp32_config.json b/examples/recipes/google_owlv2-large-patch14/cpu/cpu/zero-shot-object-detection_fp32_config.json new file mode 100644 index 000000000..d1118bd87 --- /dev/null +++ b/examples/recipes/google_owlv2-large-patch14/cpu/cpu/zero-shot-object-detection_fp32_config.json @@ -0,0 +1,75 @@ +{ + "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": "input_ids", + "dtype": "int32", + "shape": [ + 1, + 16 + ], + "value_range": [ + 0, + 49408 + ] + }, + { + "name": "pixel_values", + "dtype": "float32", + "shape": [ + 1, + 3, + 1008, + 1008 + ], + "value_range": [ + 0, + 1 + ] + }, + { + "name": "attention_mask", + "dtype": "int32", + "shape": [ + 1, + 16 + ], + "value_range": [ + 0, + 2 + ] + } + ], + "output_tensors": [ + { + "name": "logits" + }, + { + "name": "pred_boxes" + }, + { + "name": "text_embeds" + }, + { + "name": "image_embeds" + } + ] + }, + "optim": {}, + "quant": null, + "compile": null, + "loader": { + "task": "zero-shot-object-detection", + "model_class": "AutoModelForZeroShotObjectDetection", + "model_type": "owlv2" + } +}