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

Converting yolov3 to IR for openvino missing anchors

Sanchez__Ricardo
Beginner
511 Views

Hi everyone, 

My goal is to convert DeepSort coded in PyTorch (https://github.com/ZQPei/deep_sort_pytorch) to OpenVino. DeepSort uses Yolov3 as detector.

I successfully converted yolov3 to IR following this guide.

Running the pytorch model of yolo [

  • output = self.net(img)

outputs a dictionary with three keys (3 scales) and each dictionary is composed of 3 elements [x, a, n], prediction, anchors and number of anchors.

However, running the openvino model of yolo:

  • input_blob = next(iter(exec_net.inputs))
  • result = exec_net.infer({input_blob: image})

outputs a dictionary with three keys (3 scales) where each dictionary contains only the numpy array. Therefore, "a" and "n" (anchors and number of anchors) are missing. Therefore, I am unable to retreieve the detections...

Does anyone know how I can tackle this?

Thank you in advance!

 

0 Kudos
1 Reply
Munesh_Intel
Moderator
511 Views

Hi Ricardo,

Greetings to you.

OpenVINO supports certain PyTorch models via ONNX conversion, and DeepSort with PyTorch is not one of the officially supported models.

More information regarding supported PyTorch models can be obtained at the following page:

https://docs.openvinotoolkit.org/2020.3/_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_ONNX.html#supported_pytorch_models_via_onnx_conversion

 

Having said that, moving on to your question on how to tackle missing anchors, try optimizing your model by implementing decomposition for ReduceL2 layer.

More information about decomposition techniques is available at the following pages :

https://docs.openvinotoolkit.org/2020.3/_docs_MO_DG_prepare_model_Model_Optimization_Techniques.html#optimization_description

https://docs.openvinotoolkit.org/2020.3/_docs_IE_DG_supported_plugins_VPU.html#decomposition_rules

 

Additionally, detailed information of model conversion process for Faster R-CNN topologies is available at the following page:

https://docs.openvinotoolkit.org/2020.3/_docs_MO_DG_prepare_model_convert_model_tf_specific_Convert_Object_Detection_API_Models.html#faster_r_cnn_topologies

 

Regards,

Munesh

0 Kudos
Reply