In RPN head, there are some legacy codes do the following:
# set cat_id of gt_labels to 0 in RPN
for data_sample in rpn_data_samples:
data_sample.gt_instances.labels = \
torch.zeros_like(data_sample.gt_instances.labels)
However, we can keep the assignment progress of RPN the same as that in RCNN, and only re-map the learning targets of labels/logits to zero just before the loss calculation.
This unifies and simplifies the code and assignment.
Does it mean we need to add a cfg flag in rpn_cfg to handle this case? This code logic is going to handle replacing RPN to other single-stage head without any codes adding.
What's the feature?
In RPN head, there are some legacy codes do the following:
However, we can keep the assignment progress of RPN the same as that in RCNN, and only re-map the learning targets of labels/logits to zero just before the loss calculation. This unifies and simplifies the code and assignment.
Any other context?
No response