I have tf model (DeepLabv3 plus with MobileNet V2 backbone). In python open CV(4.5.1) I can read model .pb and do inference which is done correct. Here is my code.
my_im = cv2.imread(‘test.jpg’)
net = cv2.dnn.readNetFromTensorflow(‘DeepLabSegm.pb’)
inputs = cv2.dnn.blobFromImage(my_im, size=(513, 513),scalefactor=1/255.0, mean=[-123.68/255, -116.779/255,-103.939/255 ], swapRB=True)
outputs = net.forward()
This works fine and gives me output segmentation map.
But in C++, I have the same code and it gives wrong output Mat. In response I have very large numbers which are wrong.
Here is my C++ code.
From here after debugging, I see that in my response data I have very large numbers like 471316160… This is strange and I have no idea why in python I can run same functions but in c++ I have such output response.
Here is my .pb file. Deeplabv3 model - Google Drive