Different detection result between opencv and tensorflow api
- OpenCV =3.4.3(C++)
- Operating System / Platform = Windows10 64 Bit/Ubuntu 16.04
- Compiler = Visual Studio 2017
- tensorflow = 1.8.0
I have trained SSD_mobilenet_v1 model in tensorflow(num_classes:3), and i follow this web guide use tf_text_graph_ssd.py
and generate a config file,but the result of opencv is different from the tensorflow api, tensorflow detection result is accurate but opencv is not this is my config filelink and some parameters of input
net.setInput(blobFromImage(image, 2./255, Size(300, 300), Scalar(127.5, 127.5, 127.5), true,true));
In fact, I use config file( opencv provideconfig) and get the better result, but it is not like tensorflow api result
can you check the params again ? imho, for the inception tf nmodel you need swapRB=false, and a scale of 1./255
@berak, It also depends on version of OpenCV. The latest one includes preprocessing mean subtraction and scaling into TensorFlow graph. @alisa_Li, Please use
tf_text_graph_ssd.py
script from the same version of OpenCV (3.4.3).@berak my parameters come from herelink
@dkurt thank you so much:) ,now the detection result is well, I didn't think about the problem of script version