Skip to content

Commit 66de803

Browse files
YosuaMichaelfacebook-github-bot
authored andcommitted
[fbsync] fix fcos gtarea calculation (#5816)
Summary: Co-authored-by: Vasilis Vryniotis <[email protected]> Reviewed By: jdsgomes, NicolasHug Differential Revision: D36095652 fbshipit-source-id: 3b9a75c78b859d20b42d6f7c24917f79fd67a56c
1 parent cf69db9 commit 66de803

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)