Skip to content

Commit

Permalink
Confusion matrix native image-space fix (ultralytics#2046)
Browse files Browse the repository at this point in the history
Make sure the labels and predictions are equally scaled on confusion_matrix.process_batch
  • Loading branch information
ramonhollands authored Jan 26, 2021
1 parent 8fcbe43 commit d68afed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def test(data,
tbox = xywh2xyxy(labels[:, 1:5])
scale_coords(img[si].shape[1:], tbox, shapes[si][0], shapes[si][1]) # native-space labels
if plots:
confusion_matrix.process_batch(pred, torch.cat((labels[:, 0:1], tbox), 1))
confusion_matrix.process_batch(predn, torch.cat((labels[:, 0:1], tbox), 1))

# Per target class
for cls in torch.unique(tcls_tensor):
Expand Down

0 comments on commit d68afed

Please sign in to comment.