Skip to content

Update mean_avg_precision.py#118

Open
chenmingxiang110 wants to merge 1 commit intoaladdinpersson:masterfrom
chenmingxiang110:master
Open

Update mean_avg_precision.py#118
chenmingxiang110 wants to merge 1 commit intoaladdinpersson:masterfrom
chenmingxiang110:master

Conversation

@chenmingxiang110
Copy link

In case the best_gt_idx is not found

@weros21
Copy link

weros21 commented Jan 27, 2025

for idx, gt in enumerate(ground_truth_img):
                iou = intersection_over_union(
                    torch.tensor(detection[3:]),
                    torch.tensor(gt[3:]),
                    box_format=box_format,
                )
                if iou > best_iou:
                    best_iou = iou
                    best_gt_idx = idx

Have you also noticed something strange here that we not verify that best_gt_idx is not used yet ?

I think it is correct

for idx, gt in enumerate(ground_truth_img):
                iou = intersection_over_union(
                    torch.tensor(detection[3:]),
                    torch.tensor(gt[3:]),
                    box_format=box_format,
                )
                if amount_bboxes[detection[0]][idx] == 0 and iou > best_iou:
                    best_iou = iou
                    best_gt_idx = idx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants