Format for custom Anchor shapes

Hello all,

I have a very silly question that I cannot seem to find an answer for anywhere else.

I am trying to apply a pre-trained object detection network to a new dataset.
The image dimensions are much smaller than typical images used for object detection.
The objects themselves also have different shapes than typical objects.

Because of this, I defined some custom anchors based on the Anchor Generator class: rpn.py

The question: Is “sizes” in AnchorGenerator relative to the input image, or to the feature map after the backbone?

To make things more confusing, I can see the images are also resized to be quite large before feeding them to the backbone. So do the anchor sizes have to be for the original image, the resized/larger image, or the feature maps from the resized image?

I realize my setup is in the painful corner of transfer learning (small dataset, very different from original) so I could be hitting a different wall here. Just want to make sure the anchors are solid.

Thank you very much for your time!

3 Likes