0

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?

xhsoldier
  • 575
  • 6
  • 31

2 Answers2

1

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.

xhsoldier
  • 575
  • 6
  • 31
0

The common practice is scaling the input image before feeding the data into TensorFlow / TensorFlow Lite.

Note: The image in the training data set aren't 300*300 originally. The original resolution may be bigger and non-square, and it's downscaled to 300*300. It means it's totally fine to downscale 1280*720 image to 300*300 image and it should work fine.

Do you mind to try scaling and see if it works?

miaout17
  • 4,715
  • 2
  • 26
  • 32
  • Down scaling to 300 will result worse detection accuracy. I am trying to drop the last layer of the model which is not resize-able, all the other layers are fully convolutional. But I will have to pick the predicted bounding-box my self. – xhsoldier Jun 15 '18 at 05:10