HopeAI
HopeAI

Reputation: 61

Running MTCNN with OpenVino

I am trying to use OpenVino python API to run MTCNN face detection, however, the performance of the converted models degraded significantly from the original model. I am wondering how I could get similar results.

I converted the mtcnn caffe models into OpenVino *.xml and *.bin files using the following commands.

python3 mo.py --input_model path/to/PNet/det1.caffemodel --model_name det1 --output_dir path/to/output_dir
python3 mo.py --input_model path/to/RNet/det2.caffemodel --model_name det2 --output_dir path/to/output_dir
python3 mo.py --input_model path/to/ONet/det3.caffemodel --model_name det3 --output_dir path/to/output_dir

And used the step_by_step mtcnn jupyter notebook to check the performance of the converted models.

But detection results using OpenVino models degraded significantly. To regenerate the results you only need to load OpenVino models instead of pytorch model in the notebook.

To regenerate my results do the following steps.

Clone https://github.com/TropComplique/mtcnn-pytorch.git

And use this jupyter notebbok

As you will see the detected boxes in the first stage after P-Net are more than the detected boxes in the original model step_by_step mtcnn jupyter notebook.

Do you have any comment on this. It seems that there is no problem in model conversion the only difference is that pytorch has a variable tensor size (FloatTensor) but for OpenVino I have to reshape the input size for each scale. This might be the reason to get different results, however I have not been able to solve this problem.

Upvotes: 2

Views: 2479

Answers (1)

HopeAI
HopeAI

Reputation: 61

I went through all the possible mistake I might had made and check parameters to convert mtcnn models from list_topologies.yaml. This file comes with OpenVino installation and list the parameters like scale mean values and etc.

Finally, I solved the problem by using MXNET pre-trained MTCNN networks.

I hope this would help other users who might encounter this problem.

Upvotes: 1

Related Questions