Skip to content

Commit 29418e3

Browse files
Fix the confusing example of gt_pred_pairs_of_highest_quality (#7730)
Co-authored-by: Nicolas Hug <[email protected]> Co-authored-by: Nicolas Hug <[email protected]>
1 parent bb3aae7 commit 29418e3

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

torchvision/models/detection/_utils.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -408,17 +408,9 @@ def set_low_quality_matches_(self, matches: Tensor, all_matches: Tensor, match_q
408408
# Find the highest quality match available, even if it is low, including ties
409409
gt_pred_pairs_of_highest_quality = torch.where(match_quality_matrix == highest_quality_foreach_gt[:, None])
410410
# Example gt_pred_pairs_of_highest_quality:
411-
# tensor([[ 0, 39796],
412-
# [ 1, 32055],
413-
# [ 1, 32070],
414-
# [ 2, 39190],
415-
# [ 2, 40255],
416-
# [ 3, 40390],
417-
# [ 3, 41455],
418-
# [ 4, 45470],
419-
# [ 5, 45325],
420-
# [ 5, 46390]])
421-
# Each row is a (gt index, prediction index)
411+
# (tensor([0, 1, 1, 2, 2, 3, 3, 4, 5, 5]),
412+
# tensor([39796, 32055, 32070, 39190, 40255, 40390, 41455, 45470, 45325, 46390]))
413+
# Each element in the first tensor is a gt index, and each element in second tensor is a prediction index
422414
# Note how gt items 1, 2, 3, and 5 each have two ties
423415

424416
pred_inds_to_update = gt_pred_pairs_of_highest_quality[1]

0 commit comments

Comments
 (0)