From fdbdd954ef0a7170066edd97330d86c48dd4e8b1 Mon Sep 17 00:00:00 2001 From: wanghonglie Date: Sun, 30 Oct 2022 10:14:55 +0800 Subject: [PATCH] fix iou bug --- yolov6/utils/figure_iou.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yolov6/utils/figure_iou.py b/yolov6/utils/figure_iou.py index f73c4203..23248ce1 100644 --- a/yolov6/utils/figure_iou.py +++ b/yolov6/utils/figure_iou.py @@ -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