Search code examples
tensorflowtensorflow-lite

change the input image size for mobilenet_ssd using tensorflow


I am using tensorflow and tflite to detect object. The model I use is mobilenet_ssd (version 2) from https://github.com/tensorflow/models/tree/master/research/object_detection

the input image size for detection is fixed 300*300, which is hard-coded in the model. I want to input 1280*720 image for detection, how to do this? I do not have the traing image dataset of resolution 1280*720. I only have pascal and coco dataset.

How to modify the model to accept 1280*720 image(do not scale the image) for detection?


Solution

  • To change the input size of the image, you need to redesign the anchor box position. Because the anchors are fixed to the input image resolution. Once you change the anchor positions to 720P, then the mobilenet can accept 720p as input.