Skip to content

Commit 6a53c9a

Browse files
simonJJJdatumbox
andauthored
fix fcos gtarea calculation (#5816)
Co-authored-by: Vasilis Vryniotis <[email protected]>
1 parent fd4a693 commit 6a53c9a

File tree

1 file changed

+1
-1
lines changed
  • torchvision/models/detection

1 file changed

+1
-1
lines changed

torchvision/models/detection/fcos.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ def compute_loss(
471471
pairwise_match &= (pairwise_dist > lower_bound[:, None]) & (pairwise_dist < upper_bound[:, None])
472472

473473
# match the GT box with minimum area, if there are multiple GT matches
474-
gt_areas = (gt_boxes[:, 1] - gt_boxes[:, 0]) * (gt_boxes[:, 3] - gt_boxes[:, 1]) # N
474+
gt_areas = (gt_boxes[:, 2] - gt_boxes[:, 0]) * (gt_boxes[:, 3] - gt_boxes[:, 1]) # N
475475
pairwise_match = pairwise_match.to(torch.float32) * (1e8 - gt_areas[None, :])
476476
min_values, matched_idx = pairwise_match.max(dim=1) # R, per-anchor match
477477
matched_idx[min_values < 1e-5] = -1 # unmatched anchors are assigned -1

0 commit comments

Comments
 (0)