strongwolf / DW

A Dual Weighting Label Assignment Scheme for Object Detection
Apache License 2.0
136 stars 17 forks source link

The question about that the pos weight of each anchor for each instance is normalized by the sum of all pos weights within the candidate bag. #23

Closed MooresS closed 2 years ago

MooresS commented 2 years ago

Hello, I take the liberty to ask. The pos weight of each anchor for each instance is normalized by the sum of all pos weights within the candidate bag.

p_pos_weight = (torch.exp(5*p_pos) * p_pos * center_prior_weights) / (torch.exp(3*p_pos) * p_pos * center_prior_weights).sum(0, keepdim=True).clamp(min=EPS)

In this code, why is the numerator 5*p_pos but the denominator 3*p_pos?

strongwolf commented 2 years ago

This setting mainly aims to adjust the balance between pos loss and neg loss. You can refer to this issue.

MooresS commented 2 years ago

If so, is it normalized?Or it multiplies exp(2*p_pos) after normalized.

strongwolf commented 2 years ago

Yes, it can be seen that pos_weight multiplies an extra term after normalization.

MooresS commented 2 years ago

Thanks for your reply.