RobertCsordas / RFCN-tensorflow

RFCN implementation in TensorFlow
292 stars 137 forks source link

How to understanding offset? #32

Open MaskVulcan opened 6 years ago

MaskVulcan commented 6 years ago

I find that RPN and PSROIPooling all have offset and you set it to 32. I can't understand it?what's its use and where it comes from?

jackygit-alt commented 6 years ago

Does anyone else know that?

tokotchd commented 5 years ago

So, when you create anchors, you do so in feature space, where the dimensions of the feature maps are something like [batch,7,7,512] not [batch,600,600,3] When you attempt to scale these into pixel space (to get anchors for the actual image), you multiply the indices of the anchors by some scaling constant. Now my top left most anchor is still at the origin of my picture, rather than the top left corner of the anchor being at the origin of the picture.
The offset is a constant term you add to the pixel coordinates after scaling anchor coordinates into pixel space to offset each anchor down and to the right. This evenly disperses the anchors throughout the picture, rather than having a higher concentration in the top left corner. The author uses 32 as an offset because his feature_map to pixel space ratio is (presumably) approximately 64. Each anchor box needs to be offset by one half of a feature map pixel, which becomes 32 pixels in pixel space.