Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher committed Apr 26, 2019
1 parent 96ea6a8 commit 84ebb5d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,17 +124,16 @@ def test(
break

# Continue if predicted class not among image classes
m = (pcls == tcls_tensor).nonzero().view(-1) # matches
if not any(m):
if pcls.item() not in tcls:
continue

# Best iou, index between pred and targets
iou, bi = bbox_iou(pbox, tbox[m]).max(0)
iou, bi = bbox_iou(pbox, tbox).max(0)

# If iou > threshold and class is correct mark as correct
if iou > iou_thres and m[bi] not in detected: # and pcls == tcls[bi]:
if iou > iou_thres and bi not in detected: # and pcls == tcls[bi]:
correct[i] = 1
detected.append(m[bi])
detected.append(bi)

# Append statistics (correct, conf, pcls, tcls)
stats.append((correct, pred[:, 4].cpu(), pred[:, 6].cpu(), tcls))
Expand Down

0 comments on commit 84ebb5d

Please sign in to comment.