implus / GFocal

Generalized Focal Loss: Learning Qualified and Distributed Bounding Boxes for Dense Object Detection, NeurIPS2020
Apache License 2.0
575 stars 73 forks source link

distribution_focal_loss is simply CE? #1

Closed qianyizhang closed 4 years ago

qianyizhang commented 4 years ago

https://github.com/implus/GFocal/blob/master/mmdet/models/losses/gfocal_loss.py#L42-L46 `

disl = label.long()
disr = disl + 1

wl = disr.float() - label # this is (label.long() + 1).float() - label , which is simply 1.0
wr = label - disl.float() # this is label - label.long().float(), which is 0.0

` therefore, your GFL is simply CE?

implus commented 4 years ago

Hi, note that label is a float vector, so it's not simply 1.0 or 0.0. You can check the runtime values by yourself.

Thanks!