chuanqi305 / MobileNet-SSD

Caffe implementation of Google MobileNet SSD detection network, with pretrained weights on VOC0712 and mAP=0.727.
MIT License
2.02k stars 1.18k forks source link

Couldn't find any detections #19

Open beiliubei opened 7 years ago

beiliubei commented 7 years ago

use examples/ssd/ssd_detect

and then get follow result

detection_output_layer.cpp:282] Couldn't find any detections

any difference?

oceanheart99 commented 7 years ago

I encountered this issue too. And then found the reason. If you refer to demo.py, you will find the image needs to do such preprocessing:

transform_param {

scale: 0.007843

mirror: false

crop_size: 300

mean_value: [127.5, 127,5, 127.5]

}

so, you should change ssd_detect.cpp codes to set mean value (from command parameter) and do scaling correctly like below:

cv::Mat sample_normalized; cv::subtract(samplefloat, mean, sample_normalized);

+sample_normalized *= 0.007843;

/* This operation will write the separate BGR planes directly to the

firefox1031 commented 7 years ago

@oceanheart99 , Thanks for your help. I also encountered the same issue. But why do you split sample_normalized into *input_channels? There is " img = img.transpose((2, 0, 1))" in the demo.py, how can it be implemented in C++? Thanks!

oceanheart99 commented 7 years ago

@firefox1031 The above change is based on caffe/example/ssd/ssd_detect.cpp. If you use demo.py, there is no such issue.

1120651074 commented 7 years ago

hi @oceanheart99 I can't download the caffemodel file and the prototxt file from googledrive .If it is convenient, could you share your download files, thanks very much ! my email is 1120651074@qq.com thanks again.