This commit is contained in:
Glenn Jocher 2019-02-21 20:45:53 +01:00
parent e62736f8a8
commit 3f68a6776a
1 changed files with 2 additions and 1 deletions

View File

@ -251,12 +251,13 @@ def build_targets(target, anchor_wh, nA, nC, nG):
# Unique anchor selection
u = torch.cat((gi, gj, a), 0).view((3, -1))
# u = torch.stack((gi, gj, a),0)
_, first_unique = np.unique(u[:, iou_order], axis=1, return_index=True) # first unique indices
# _, first_unique = torch.unique(u[:, iou_order], dim=1, return_inverse=True) # different than numpy?
i = iou_order[first_unique]
# best anchor must share significant commonality (iou) with target
i = i[iou_best[i] > 0.10]
i = i[iou_best[i] > 0.10] # TODO: arbitrary threshold is problematic
if len(i) == 0:
continue