From 78dfa384ee27020ef72b9c2ddccad29a7a9ffcc1 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Mon, 23 Dec 2019 12:24:48 -0800 Subject: [PATCH] updates --- utils/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/utils.py b/utils/utils.py index 02a3b6a6..32484956 100755 --- a/utils/utils.py +++ b/utils/utils.py @@ -377,7 +377,8 @@ def compute_loss(p, targets, model): # predictions, targets, model # GIoU pxy = torch.sigmoid(ps[:, 0:2]) # pxy = pxy * s - (s - 1) / 2, s = 1.5 (scale_xy) - pbox = torch.cat((pxy, torch.exp(ps[:, 2:4]).clamp(max=1E3) * anchor_vec[i]), 1) # predicted box + pwh = torch.exp(ps[:, 2:4]).clamp(max=1E3) * anchor_vec[i] + pbox = torch.cat((pxy, pwh), 1) # predicted box giou = 1.0 - bbox_iou(pbox.t(), tbox[i], x1y1x2y2=False, GIoU=True) # giou computation lbox += giou.sum() if red == 'sum' else giou.mean() # giou loss