Jitesh Malipeddi
Jitesh Malipeddi

Reputation: 2385

is it necessary for all images to be of same size while using the tensorflow object detection api?

I have a set of images(already labelled) which are of different resolutions and I wish to train these using the object detection api. Can I train it if all my images are of different sizes by specifying the min_dimension and max_dimension in the config file to be the greatest width and smallest height respectively?

Upvotes: 4

Views: 2108

Answers (1)

Ajinkya
Ajinkya

Reputation: 1867

No, it is not necessary for all images to be of same size while using the tensorflow object detection api.

You don't need to resize the training images. That is taken care by the script itself. Whatever dimensions your images are they are internally resized by the config file.

Here is a sample of ssdmobilenet config file

image_resizer {
  fixed_shape_resizer {
    height: 300
    width: 300
  }

The image resizer resizes all your images to 300x300 and takes them into training.

Further if you want high accuracy you can change these values from your config file as follows (please note doing this takes more time to train your model )

image_resizer {
  fixed_shape_resizer {
    height: 600
    width: 800
  }

Whatever values you choose to add to the image resizer be sure all your image dimensions are >= image resizer dimensions. Other wise you will get tensor shape mismatch error.

Upvotes: 2

Related Questions