CoinCheung / pytorch-loss

label-smooth, amsoftmax, partial-fc, focal-loss, triplet-loss, lovasz-softmax. Maybe useful

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

use of TO_REMOVE in GIOU loss

souvik3333 opened this issue · comments

is there a reason to use "TO_REMOVE" while calculating the intersection between bounding boxes?

wh = (rb - lt + TO_REMOVE).clamp(min=0)

Because when I print the gt_area, pr_area, intersection, union they result as 4,4,4,4 for given example in the loss file. But from the example, it should be 4,4, 1, 7 respectively or am I missing something?

I add this for boundary and division safety. Its values is 1 which means counting one more pixel when computing the bbox width. Personally, I believe this would not bring a big difference of the result since bboxes are not measured in pixel level(the ground truth can be annotated with a bias of a few pixels).