OpenCV dnn: Precision Loss when using TensorFlow Object Detection model
I using the code from this: https://github.com/opencv/opencv/wiki...
I use the same network and model to run the SSD-Mobilenet detection. But when I run the network in opencv, the result is obviously worse than the same model runing in Tensorflow.
Why? And what can I do to solve it?
the output in opencv3.4.1:(threshould0.5 nms0.5)
the output in tensorflow1.4:(the same nms and threshould config)
@seefun, please specify a model did you use. Also the version of OpenCV. Attached images will also be more useful.
@dkurt ,my OpenCV version is 3.4.1 use the tensorflow object detection api config file in this: https://github.com/tensorflow/models/...
@seefun, is it possible to share a frozen graph to reproduce results?
@dkurt can you give me your e-mail. I'll send it to you. Thanks a lot
@seefun, please check it in profile, http://answers.opencv.org/users/13258... . BTW, have you tested MobileNet-SSD models using your code and script to generate
.pbtxt
file rather using attached ones? Maybe it's not necessary to share the model and we can find a mistake in application code. Did you use exactly the same python code as added in wiki page?@dkurt I use the latest script in this wiki pages to creat .pbtxt file, and try these two menthod from trouble shooting, but I get the error:
error: (-215) !_aspectRatios.empty(), _minSize > 0 in function cv::dnn::PriorBoxLayerImpl::PriorBoxLayerImpl
my graph.pb is here https://jbox.sjtu.edu.cn/l/71KeO6
@seefun, May I ask you to check OpenCV source code state? Do you really use OpenCV 3.4.1? Please print OpenCV version using
CV_VERSION
in C++ orcv2.__version__
in python.@dkurt Ohh,I use the wrong version of OpenCV. But when I use the latest OpenCV3.4.1, the result from Tensorflow and OpenCV are still different. The bandboxs output from OpenCV are sometimes too small or too big . Whether the output size of bandbox are fixed? or opencv delete the box regression operation?
@seefun, Could you please check a link to the model because I couldn't download it nigher yesterday nor now. If you cannot share a model please try to generate
.pbtxt
file for a public MobileNet-SSD model and test it too. Otherwise it's hard to debug remotely.@dkurthttps://jbox.sjtu.edu.cn/l/wJoO4y