jwyang / faster-rcnn.pytorch

A faster pytorch implementation of faster r-cnn
MIT License
7.68k stars 2.33k forks source link

Dimensions of anchor boxes #427

Open rnjtsh opened 5 years ago

rnjtsh commented 5 years ago

Can someone explain how dimensions of the anchor boxes are calculated from anchor ANCHOR_SCALES and ANCHOR_RATIOS? How do they relate to generating 1:1, 1:2 or 2:1 aspect ratio anchor boxes with box areas 128^2, 256^2 as mentioned in the Faster RCNN paper?

Sorry to bother you.

bmaneesh commented 5 years ago

https://github.com/jwyang/faster-rcnn.pytorch/blob/master/lib/model/rpn/generate_anchors.py

this one is all about scaling anchor boxes. By default they produce 3x3=9 scale-ratio boxes. You have scales of 8 and 16 and begin with 16x16 base size boxes. The math adds up to 128 and 256 sq. boxes at ratio=1.