Is preprocessing like input normalization made by default by Tensorflow Object Detection API ?
I cannot find anywhere any documentation on it. There is an option called 'NormalizeImage' in the DataAugmentations. In all the configuration files for the models in the zoo I never see it used. I trained ssd_mobilenet_v3_small_coco_2020_01_14
for transfer learning to my custom class without using it and everything works.
I know there is a similar question here but there is no answer in a couple of years and the network is different.
Testing with the following code (OpenCV 4.3.0 DNN module) produce the correct result:
import cv2 as cv
net = cv.dnn_DetectionModel('model/graph/frozen_inference_graph.pb', 'cvgraph.pbtxt')
net.setInputSize(300, 300)
#net.setInputScale(1.0 / 127.5)
#net.setInputMean((127.5, 127.5, 127.5))
net.setInputSwapRB(True)
frame = cv.imread('test/2_329_985_165605-561561.jpg')
classes, confidences, boxes = net.detect(frame, confThreshold=0.7)
for classId, confidence, box in zip(classes.flatten(), confidences.flatten(), boxes):
print(classId, confidence)
cv.rectangle(frame, box, color=(0, 255, 0))
cv.imshow('out', frame)
cv.waitKey()
While here normalization is used. Using normalization in my case produce a wrong result, bounding box is much bigger than it should be. I guess that input normalization is somewhere performed under the hood by tensorflow?