I do not have understand about anchor_head.py because of :
num_total_samples = (num_total_pos if self.use_focal_loss else
num_total_pos + num_total_neg)
and I think that focal_loss also should use every sample for loss, and devide by number of every sample : num_total_pos + num_total_neg.
Please make me understand why focal loss use only num_total_pos.
When using focal loss, no bbox sampling is performed and the number of neg bboxes is very large. We follow the official implementation to use pos bboxes only .
Does it related in part of paper,
"The total focal loss of an image is computed as the sum of the focal loss over all ~100k anchors, normalized by the number of anchors assigned to a ground-truth box."
??
"Anchors assigned to a ground-truth box" means positive sample, is it right?
You got it.
Thanks for your graceful help!
Most helpful comment
When using focal loss, no bbox sampling is performed and the number of neg bboxes is very large. We follow the official implementation to use pos bboxes only .