opencv / opencv_contrib

Repository for OpenCV's extra modules
Apache License 2.0
9.42k stars 5.76k forks source link

DNN Single Shot MultiBox Detector (SSD) Execution Errors #935

Closed yshen92 closed 7 years ago

yshen92 commented 7 years ago
System information (version)
Detailed description

After successfully compiling the OpenCV3.2 [SSD sample code],

Any advice is greatly appreciated. Thank you.

yshen92 commented 7 years ago

I have managed to come up with a solution by comparing the deploy.prototxt with the OpenCV3.2 prototxt and then apply the changes accordingly.

P.S. Thank you for the awesome work on the library!

lf2653 commented 7 years ago

I meet the same problem.Could you help me?how to change the prototxt. Thank you.

lf2653 commented 7 years ago

I got it,too! It is different name for the same param! normalize_bbox_param==norm_param

ghost commented 7 years ago

Wow, thanks for integration!

wkroach commented 7 years ago

I meet such problem ether, but how to change the prototxt in detail? I am new to caffe and I felt excited when I knew OpenCV supports SSD nevertheless it doesn't work.

yshen92 commented 7 years ago

Hi, the library works actually. It's just that they seem to not support some of the parameters and uses different layer type names.

A quick check on www.diffchecker.com between the supplied prototxt example and any of the downloaded model from the SSD author will let you know what to change.

If my memory serves me well, you will have to change "Normalize" to "NormalizeBBox", norm_param to normalize_bbox_param, remove all step and offset, and also amend the detection_output_param in the last layer.

Good luck!

wkroach commented 7 years ago

It works amazingly! Thank you so much!

anupamsobti commented 7 years ago

Leaving the modified file here for anyone else facing this issue. deploy.txt

You can rename this file to deploy.prototxt and use the following command: ./example_dnn_ssd_object_detection --image=./rgb_frame40.png --model=VGG_VOC0712_SSD_300x300_iter_120000.caffemodel --proto=deploy.prototxt --min_confidence=0.5