sampleUffSSD config.py as input of different width and height.

In config.py

PriorBox = gs.create_node("PriorBox",
    numLayers=6,
    minScale=0.2,
    maxScale=0.95,
    aspectRatios=[1.0, 2.0, 0.5, 3.0, 0.33],
    layerVariances=[0.1,0.1,0.2,0.2],
    featureMapShapes=[19, 10, 5, 3, 2, 1])

the featureMapShapes is for input size of 300x300, my new model’s input is 800x1000, how to set the featureMapShapes param? should i set it by height or width? thank you.

Are you using a completely different model are you trying to change the input size of the SSD model?

I use the model “ssd_mobilenet_v1”, but use a different input size of (1000x800).

In the tensorflow version you are converting, NN does a resize to 300x300 itself and then works with the image of this size. In the config.py we are discarding of all the Preprocessing and thus we need to make a resize ourselves. So it’s not quite possible to make an input of other size than 300x300 as of right now without changing a whole architecture of the network.

Hope it makes sense.

I was struggling with the same issue after training a model with input size 100 x 100.
I have found out how to set the featureMapShapes parameter for this size by simply having the Object Detection API print the sizes upon construction of the model.

To do this, open models/feature_map_generators.py (https://github.com/tensorflow/models/blob/master/research/object_detection/models/feature_map_generators.py). Then, add a few lines at the end of the multi_resolution_feature_maps function so that the final lines look like this:

...
  feature_maps.append(feature_map)
  print('FEATURE MAP SIZE: {}'.format(feature_map.get_shape))
import sys
sys.exit(0)
return collections.OrderedDict(
      [(x, y) for (x, y) in zip(feature_map_keys, feature_maps)])
...

Then, start the training script. After a few seconds, it should output the above print statement for each SSD layer, with the corresponding feature map size and then exit. For example, a 100 x 100 input size correponds to the following feature map sizes: [7, 4, 2, 1, 1, 1].

Note that this still only works for square input sizes.