Skip to content

Commit 48adeca

Browse files
committed
Fix incorrect boxes slicing in postprocess_detections
1 parent 6473b77 commit 48adeca

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

torchvision/models/detection/roi_heads.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,8 @@ def postprocess_detections(
698698
labels = labels.view(1, -1).expand_as(scores)
699699

700700
# remove predictions with the background label
701-
boxes = boxes[:, 1:]
701+
boxes = boxes.reshape(-1, num_classes, 4)
702+
boxes = boxes[..., 1:, :]
702703
scores = scores[:, 1:]
703704
labels = labels[:, 1:]
704705

0 commit comments

Comments
 (0)