Could anyone illustrate what is the intuition of add the ground truth bbox during training?
if self.training and targets is not None:
boxlists = self.add_gt_proposals(boxlists, targets)
Thanks a lot!
I believe it is a hack to provide data to roi_heads classification task during training. These ground-truth bboxes are not taken into account in the rpn loss, as you can see here, buy they are taken into account in the roi_heads loss, as you can see here.
Once they are fed into the roi_heads loss evaluator, they will only generator meaningful information to the classification loss, since its bounding boxes must match perfectly to the targets, no regression loss is generated, then no gradients either.
Thus, this feeds your roi_heads with some useful information to train even in the early stages of the training process.
I'm not sure though this is the only reason.
Thanks a lot, that explanation makes sense to me!
This definitely can make the model converge faster. Otherwise, the training of roi_heads would wait until RPN converge first. Besides, it can also make sure the input to the roi_heads is not empty. If the input is empty, it will cause some problems now and hard to solve it now.
I'm closing this issue, please let me know if you have any further question.
Most helpful comment
I believe it is a hack to provide data to
roi_headsclassification task during training. These ground-truth bboxes are not taken into account in the rpn loss, as you can see here, buy they are taken into account in theroi_headsloss, as you can see here.Once they are fed into the
roi_headsloss evaluator, they will only generator meaningful information to the classification loss, since its bounding boxes must match perfectly to the targets, no regression loss is generated, then no gradients either.Thus, this feeds your
roi_headswith some useful information to train even in the early stages of the training process.I'm not sure though this is the only reason.