This commit is contained in:
Glenn Jocher
2019-03-04 15:59:11 +01:00
parent 0b3a17362c
commit 175e231c55
2 changed files with 3 additions and 2 deletions
+3
View File
@@ -256,6 +256,9 @@ def build_targets(target, anchor_vec, nA, nC, nG):
# iou of targets-anchors (using wh only)
box1 = gwh
box2 = anchor_vec.unsqueeze(1)
print(box1.device,box2.device)
inter_area = torch.min(box1, box2).prod(2)
iou = inter_area / (box1.prod(1) + box2.prod(2) - inter_area + 1e-16)