Intel® Distribution of OpenVINO™ Toolkit
Community support and discussions about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all things computer vision-related on Intel® platforms.

Optimising a Detectron model using OpenVino

Juj__Satyajith
Beginner
290 Views

Hello.

The following page states 'This sample demonstrates how to run Instance Segmentation models from Detectron or maskrcnn-benchmark using OpenVINO'

https://docs.openvinotoolkit.org/latest/_inference_engine_ie_bridges_python_sample_instance_segmenta...

I do not however understand how to optimise a Detectron model first. Any help would be appreciated.

Thank you,

Satyajith J

0 Kudos
2 Replies
Shubha_R_Intel
Employee
290 Views

Dear Juj, Satyajith, 

As I mentioned in the below post, the trick is to convert the *.pkl to a *.pb since Model Optimizer doesn't support *.pkl format. 

https://software.intel.com/en-us/forums/computer-vision/topic/808438#comment-1939297

https://github.com/facebookresearch/Detectron/blob/master/tools/convert_pkl_to_pb.py

However I will file a bug in the OpenVino documentation because as you pointed out, Detectron is mentioned as supported with zero further instruction or information.

Thanks !

Shubha

 

Juj__Satyajith
Beginner
290 Views

Dear Shubha,

Thank you for your reply. The convert_pkl_to_pb.py script converts the model to a format compatible with the caffe2 framework. Intel OpenVINO does not support Caffe2 (or PyTorch, the framework powering Detectron).

According to the instance segmentation model XML file, in the following url, the model was converted from the ONNX format. ONNX does not currently support the Detectron framework. However, it does support Caffe2 and PyTorch.

https://download.01.org/opencv/2019/open_model_zoo/R1/20190404_140900_models_bin/instance-segmentati...

I have tried Detectron -> Caffe2 -> ONNX and it fails. They seem to have used a custom layer mapping. At the end of the file there is a CLI parameter  <k value="DIR/CustomLayersMapping.xml"/>

Thank you for filing the issue.

Reply