[Master] Cascade RCNN res101 document model support (#10902)

* cascade rcnn model support

* fix typo

* specify model directory

* comments resolving
This commit is contained in:
Yegor Kruglov 2022-03-16 18:16:28 +03:00 committed by GitHub
parent 25e1f6ac97
commit 7cfd8698ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 0 deletions

View File

@ -25,6 +25,7 @@
openvino_docs_MO_DG_prepare_model_convert_model_onnx_specific_Convert_GPT2
openvino_docs_MO_DG_prepare_model_convert_model_onnx_specific_Convert_Mask_RCNN
openvino_docs_MO_DG_prepare_model_convert_model_pytorch_specific_Convert_Bert_ner
openvino_docs_MO_DG_prepare_model_convert_model_pytorch_specific_Convert_Cascade_RCNN_res101
openvino_docs_MO_DG_prepare_model_convert_model_pytorch_specific_Convert_F3Net
openvino_docs_MO_DG_prepare_model_convert_model_pytorch_specific_Convert_QuartzNet
openvino_docs_MO_DG_prepare_model_convert_model_pytorch_specific_Convert_RCAN

View File

@ -0,0 +1,28 @@
# Convert PyTorch Cascade RCNN R-101 Model {#openvino_docs_MO_DG_prepare_model_convert_model_pytorch_specific_Convert_Cascade_RCNN_res101}
## Download and Convert Model to ONNX
* Clone the [repository](https://github.com/open-mmlab/mmdetection):
```bash
git clone https://github.com/open-mmlab/mmdetection
cd mmdetection
```
> **NOTE**: To set up an environment, refer to this [instruction](https://github.com/open-mmlab/mmdetection/blob/master/docs/en/get_started.md#installation).
* Download the pre-trained [model](https://download.openmmlab.com/mmdetection/v2.0/cascade_rcnn/cascade_rcnn_r101_fpn_1x_coco/cascade_rcnn_r101_fpn_1x_coco_20200317-0b6a2fbf.pth). You can also find the link to the model [here](https://github.com/open-mmlab/mmdetection/blob/master/configs/cascade_rcnn/README.md).
* To convert the model to ONNX format, use this [script](https://github.com/open-mmlab/mmdetection/blob/master/tools/deployment/pytorch2onnx.py).
```bash
python3 tools/deployment/pytorch2onnx.py configs/cascade_rcnn/cascade_rcnn_r101_fpn_1x_coco.py cascade_rcnn_r101_fpn_1x_coco_20200317-0b6a2fbf.pth --output-file cascade_rcnn_r101_fpn_1x_coco.onnx
```
The script generates ONNX model file `cascade_rcnn_r101_fpn_1x_coco.onnx` in the directory `tools/deployment/`. If required, you can specify the model name or output directory using `--output-file <path-to-dir>/<model-name>.onnx`
## Convert ONNX Cascade RCNN R-101 Model to IR
```bash
mo --input_model cascade_rcnn_r101_fpn_1x_coco.onnx --mean_values [123.675,116.28,103.53] --scale_values [58.395,57.12,57.375]
```