mmdeploy/docs/backends/openvino.md
Semyon Bevzyuk bb9b0a98de
[Enhancement]: Added static config and CI tests for OpenVINO. (#218)
* Add openvino_static.

* Add openvino-dev.

* Fix skipping ORT tests in test_mmocr_models.

* Updated docs.

* Fix print.

* Fix

* Fix

* Fix other backends

* Fix is_available

* fix ncnn

* Add constrict for get rewrite output

* add not

* Fix

* fix

* Fix

* Fix

* Improve tests

* Remove rebundant `cuda`

* Prevent None object and rename variable

* Fix multi-line string

* rename get_backend_checker

* Add Troubleshooting to doc.

* Fix postprocessing_masks with empty masks.

* Fix tests

* lint

* Update docs.

Co-authored-by: SingleZombie <singlezombie@163.com>
2021-12-01 14:03:48 +08:00

3.9 KiB

OpenVINO Support

This tutorial is based on Linux systems like Ubuntu-18.04.

Installation

It is recommended to create a virtual environment for the project.

  1. Install OpenVINO. For example, you can install OpenVINO with pip.
pip install openvino-dev
  1. Install PyTorch.
pip install torch torchvision
  1. Install MMCV. It is advisable to install the latest version mmcv-full.
pip install mmcv-full
  1. Install MMDeploy following the instructions.

To work with models from MMDetection, you may need to install it additionally.

Troubleshooting

ImportError: libpython3.7m.so.1.0: cannot open shared object file: No such file or directory

To resolve missing external dependency on Ubuntu*, execute the following command:

sudo apt-get install libpython3.7

Usage

Example:

python tools/deploy.py \
    configs/mmdet/detection/detection_openvino_dynamic.py \
    /mmdetection_dir/mmdetection/configs/ssd/ssd300_coco.py \
    /tmp/snapshots/ssd300_coco_20210803_015428-d231a06e.pth \
    tests/data/tiger.jpeg \
    --work-dir ../deploy_result \
    --device cpu \
    --log-level INFO \

List of supported models exportable to OpenVINO from MMDetection

The table below lists the models that are guaranteed to be exportable to OpenVINO from MMDetection.

Model name Config Dynamic Shape
ATSS configs/atss/atss_r50_fpn_1x_coco.py Y
Cascade Mask R-CNN configs/cascade_rcnn/cascade_mask_rcnn_r50_fpn_1x_coco.py Y
Cascade R-CNN configs/cascade_rcnn/cascade_rcnn_r50_fpn_1x_coco.py Y
Faster R-CNN configs/faster_rcnn/faster_rcnn_r50_fpn_1x_coco.py Y
FCOS configs/fcos/fcos_x101_64x4d_fpn_gn-head_mstrain_640-800_4x2_2x_coco.py Y
FoveaBox configs/foveabox/fovea_r50_fpn_4x4_1x_coco.py Y
FSAF configs/fsaf/fsaf_r50_fpn_1x_coco.py Y
Mask R-CNN configs/mask_rcnn/mask_rcnn_r50_fpn_1x_coco.py Y
RetinaNet configs/retinanet/retinanet_r50_fpn_1x_coco.py Y
SSD configs/ssd/ssd300_coco.py Y
YOLOv3 configs/yolo/yolov3_d53_mstrain-608_273e_coco.py Y
YOLOX configs/yolox/yolox_tiny_8x8_300e_coco.py Y
Faster R-CNN + DCN configs/dcn/faster_rcnn_r50_fpn_dconv_c3-c5_1x_coco.py Y
VFNet configs/vfnet/vfnet_r50_fpn_1x_coco.py Y

Notes:

  • Custom operations from OpenVINO use the domain org.openvinotoolkit.
  • For faster work in OpenVINO in the Faster-RCNN, Mask-RCNN, Cascade-RCNN, Cascade-Mask-RCNN models the RoiAlign operation is replaced with the ExperimentalDetectronROIFeatureExtractor operation in the ONNX graph.
  • Models "VFNet" and "Faster R-CNN + DCN" use the custom "DeformableConv2D" operation.

FAQs

  • None