[Deprecated] Quantizing Object Detection Model with Accuracy Control¶
Danger
Post-training Optimization Tool is deprecated since OpenVINO 2023.0. Neural Network Compression Framework (NNCF) is recommended for the post-training quantization instead.
This example demonstrates the use of the Post-training Optimization Toolkit API to quantize an object detection model in the accuracy-aware mode. The MobileNetV1 FPN model from TensorFlow for object detection task is used for this purpose. A custom DataLoader
is created to load the COCO dataset for object detection task and the implementation of mAP COCO is used for the model evaluation. The code of the example is available on GitHub.
How to prepare the data¶
To run this example, you will need to download the validation part of the COCO. The images should be placed in a separate folder, which will be later referred to as <IMAGES_DIR>
and the annotation file instances_val2017.json
later referred to as <ANNOTATION_FILE>
.
How to Run the example¶
Launch Model Downloader tool to download
ssd_mobilenet_v1_fpn_coco
model from the Open Model Zoo repository.omz_downloader --name ssd_mobilenet_v1_fpn_coco
Launch Model Converter tool to generate Intermediate Representation (IR) files for the model:
omz_converter --name ssd_mobilenet_v1_fpn_coco --mo <PATH_TO_MODEL_OPTIMIZER>/mo.py
Launch the example script from the example directory:
python ./object_detection_example.py -m <PATH_TO_IR_XML> -d <IMAGES_DIR> --annotation-path <ANNOTATION_FILE>
Optional: you can specify .bin file of IR directly using the
-w
,--weights
options.