kuangliu / pytorch-retinanet

RetinaNet in PyTorch
993 stars 249 forks source link

Question about `anchor_areas` #23

Open zengyu714 opened 6 years ago

zengyu714 commented 6 years ago

This init func in encoder.py first sets the anchor area of the corresponding feature map (p3 --> p7): self.anchor_areas = [32 * 32., 64 * 64., 128 * 128., 256 * 256., 512 * 512.] and then combines with the anchor location:

wh = self.anchor_wh[i].view(1, 1, 9, 2).expand(fm_h, fm_w, 9, 2)
box = torch.cat([xy, wh], 3)

I do think the anchor areas should be adjusted by the actual object size, especially when the input image is small. Given that we encode the boxes in advance, we should take care of the setting of anchor areas.

Is this understanding right?