Tensorflow object detection has different results between Python and C++(OpenCV)

asked 2020-02-10 05:53:40 -0600

FishCoder gravatar image

Hello, i trained a model by using TF OF API. Then, when i tested the model with Python and C++(OpenCV) codes linked below, i am getting different results. The results getting from Python is better than C++(OpenCV) results. What does cause this difference?

Python Test Code: https://github.com/vijaydwivedi75/Custom-Mask RCNN_TF/blob/master/mask_rcnn_eval.ipynb

C++(OpenCV) Test Code: https://github.com/spmallick/learnopencv/blob/master/Mask-RCNN/mask_rcnn.cpp

Trained Model and Sample Images: https://drive.google.com/open?id=18RaJfk6-DXfZJWEL61YdOAztoJxdUbua

I am getting .pb model from checkpoints by using this code: https://github.com/tensorflow/models/blob/master/research/object_detection/export_inference_graph.py

I am getting .pbtxt file by using this code: https://github.com/opencv/opencv/blob/master/samples/dnn/tf_text_graph_mask_rcnn.py

OpenCV Version: 4.2.0, Tensorflow Version using for train: 1.12.0

Thanks for your help.

edit retag flag offensive close merge delete

Comments

Hello! I know this is a quite old answer but I have the same results did you find a solution? I noticed something a bit weird. It seems that the model that has been trained within TF OD API using the object_detection/legacy/train.py are doing okay whereas the one that have been trained using the new model_main.py (that does the evaluation at the same time) have the issue you reported. EDIT : just saw you're StackOverflow question nevermind (https://stackoverflow.com/questions/6...)

dnl_anoj gravatar imagednl_anoj ( 2020-09-25 06:40:24 -0600 )edit