updates
This commit is contained in:
parent
e5b5d6a880
commit
609a9d94cf
|
@ -399,7 +399,7 @@ def compute_loss(p, targets, model): # predictions, targets, model
|
|||
pbox = torch.cat((pxy, pwh), 1) # predicted box
|
||||
giou = bbox_iou(pbox.t(), tbox[i], x1y1x2y2=False, GIoU=True) # giou computation
|
||||
lbox += (1.0 - giou).sum() if red == 'sum' else (1.0 - giou).mean() # giou loss
|
||||
tobj[b, a, gj, gi] = 1.0 # giou.type(tobj.dtype) # obj
|
||||
tobj[b, a, gj, gi] = 1.0 # giou.detach().type(tobj.dtype) * 0.5 + 0.5 # obj
|
||||
|
||||
if 'default' in arc and model.nc > 1: # cls loss (only if multiple classes)
|
||||
t = torch.zeros_like(ps[:, 5:]) # targets
|
||||
|
|
Loading…
Reference in New Issue