Adding GT Boxes to Proposals in RoIHeads

Hi There, and thanks in advance for your time.

In the select_training_samples method of the RoIHeads class (from torchvision/models/detection/roi_heads.py), the ground truth boxes for each image are concatenated onto the proposal tensors via the add_gt_proposals method. A few lines later, the assign_targets_to_proposals method is called, and if I understand this correctly it will end up matching the GT targets perfectly to the same GT boxes that were just added to the proposal tensors. I am not sure why this is desirable.

Is my understanding correct? If so, why is this happening?

1 Like