Skip to content

Commit

Permalink
fix iou bug
Browse files Browse the repository at this point in the history
  • Loading branch information
wanghonglie authored and Chilicyy committed Nov 4, 2022
1 parent 0828aac commit fdbdd95
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions yolov6/utils/figure_iou.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ def __call__(self, box1, box2):
iou = iou - (rho2 / c2 + v * alpha)
elif self.iou_type == 'siou':
# SIoU Loss https://arxiv.org/pdf/2205.12740.pdf
s_cw = (b2_x1 + b2_x2 - b1_x1 - b1_x2) * 0.5
s_ch = (b2_y1 + b2_y2 - b1_y1 - b1_y2) * 0.5
s_cw = (b2_x1 + b2_x2 - b1_x1 - b1_x2) * 0.5 + self.eps
s_ch = (b2_y1 + b2_y2 - b1_y1 - b1_y2) * 0.5 + self.eps
sigma = torch.pow(s_cw ** 2 + s_ch ** 2, 0.5)
sin_alpha_1 = torch.abs(s_cw) / sigma
sin_alpha_2 = torch.abs(s_ch) / sigma
Expand Down

0 comments on commit fdbdd95

Please sign in to comment.