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 84ebb5d commit e1850bf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,13 @@ def test(
continue

# Best iou, index between pred and targets
iou, bi = bbox_iou(pbox, tbox).max(0)
m = (pcls == tcls_tensor).nonzero().view(-1)
iou, bi = bbox_iou(pbox, tbox[m]).max(0)

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

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

1 comment on commit e1850bf

@glenn-jocher
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit fixes the recall > 1 issue from #222. It now produces COCO test mAP@50 of 0.554 vs 0.565 pycocotools, so repo mAP is about 1% behind pycocotools mAP (not too bad :).

Please sign in to comment.