siriusdemon / Build-Your-Own-Face-Model

Build your own ArcFace, CenterFace/Centernet
334 stars 69 forks source link

感谢up。 #4

Closed jiangtaoo2333 closed 4 years ago

jiangtaoo2333 commented 4 years ago

受益匪浅,十分感谢。 centernet loss那里好像有点问题。 热力图,中心点偏移,宽高应该不能都用统一的regloss替代把。

在https://github.com/xingyizhou/CenterNet/blob/master/src/main.py,中原作者用了

self.crit = torch.nn.MSELoss() if opt.mse_loss else FocalLoss() self.crit_reg = RegL1Loss() if opt.reg_loss == 'l1' else \ RegLoss() if opt.reg_loss == 'sl1' else None self.crit_wh = torch.nn.L1Loss(reduction='sum') if opt.dense_wh else \ NormRegL1Loss() if opt.norm_wh else \ RegWeightedL1Loss() if opt.cat_spec_wh else self.crit_reg

siriusdemon commented 4 years ago

您好! 热力图用的是 L2 损失,其他用的是 Regloss。 我在文中已经说明了,这样用是为了简化。因为用什么损失函数,这是可以有很多选择的。损失函数也并不是 centerface 的关键所在。您可以关注下 DBFace,他们用了 GIoU,比原 Centerface 的效果还好。