2021-10-21 16:07:35 +08:00
## OpenVINO Support
This tutorial is based on Linux systems like Ubuntu-18.04.
### Installation
2021-12-01 14:03:48 +08:00
It is recommended to create a virtual environment for the project.
2021-12-06 10:31:32 +08:00
1. Install [OpenVINO ](https://docs.openvino.ai/2021.4/get_started.html ). It is recommended to use the installer or install using pip.
Installation example using [pip ](https://pypi.org/project/openvino-dev/ ):
2021-12-01 14:03:48 +08:00
```bash
pip install openvino-dev
```
2022-01-26 17:51:23 +08:00
2. *`Optional` If you want to use OpenVINO in SDK, you need install OpenVINO with [install_guides ](https://docs.openvino.ai/2021.4/openvino_docs_install_guides_installing_openvino_linux.html#install-openvino ).
3. Install MMDeploy following the [instructions ](../build.md ).
2021-12-01 14:03:48 +08:00
To work with models from [MMDetection ](https://github.com/open-mmlab/mmdetection/blob/master/docs/get_started.md ), you may need to install it additionally.
2021-10-21 16:07:35 +08:00
2021-12-01 14:03:48 +08:00
### 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:
```bash
sudo apt-get install libpython3.7
```
2021-10-21 16:07:35 +08:00
### Usage
Example:
```bash
python tools/deploy.py \
2022-02-24 16:09:58 +08:00
configs/mmdet/detection/detection_openvino_static-300x300.py \
2021-10-21 16:07:35 +08:00
/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 \
2021-12-06 10:31:32 +08:00
--log-level INFO
2021-10-21 16:07:35 +08:00
```
### 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.
2021-11-30 15:00:11 +08:00
| Model name | Config | Dynamic Shape |
2021-11-12 10:39:42 +08:00
| :----------------: | :-----------------------------------------------------------------------: | :-----------: |
2021-11-30 15:00:11 +08:00
| ATSS | `configs/atss/atss_r50_fpn_1x_coco.py` | Y |
2021-11-12 10:39:42 +08:00
| Cascade Mask R-CNN | `configs/cascade_rcnn/cascade_mask_rcnn_r50_fpn_1x_coco.py` | Y |
2021-11-30 15:00:11 +08:00
| 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 |
2021-10-21 16:07:35 +08:00
Notes:
2021-12-23 13:23:39 +08:00
2021-12-01 14:03:48 +08:00
- Custom operations from OpenVINO use the domain `org.openvinotoolkit` .
2021-11-03 10:27:48 +08:00
- For faster work in OpenVINO in the Faster-RCNN, Mask-RCNN, Cascade-RCNN, Cascade-Mask-RCNN models
2021-10-21 16:07:35 +08:00
the RoiAlign operation is replaced with the [ExperimentalDetectronROIFeatureExtractor ](https://docs.openvinotoolkit.org/latest/openvino_docs_ops_detection_ExperimentalDetectronROIFeatureExtractor_6.html ) operation in the ONNX graph.
2021-11-16 10:59:59 +08:00
- Models "VFNet" and "Faster R-CNN + DCN" use the custom "DeformableConv2D" operation.
2021-12-01 14:03:48 +08:00
### FAQs
- None