Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MeanAveragePrecision() in torchmetrics==1.0.0 seems to be not working properly #1908

Closed
nisyad-ms opened this issue Jul 11, 2023 · 1 comment · Fixed by #1913
Closed

MeanAveragePrecision() in torchmetrics==1.0.0 seems to be not working properly #1908

nisyad-ms opened this issue Jul 11, 2023 · 1 comment · Fixed by #1913
Labels
bug / fix Something isn't working help wanted Extra attention is needed
Milestone

Comments

@nisyad-ms
Copy link

nisyad-ms commented Jul 11, 2023

🐛 Bug

Consider the example below where we try to compute mAP for a single threshold=0.2. The expected answer is 1.0, but we receive result['map'] = 0.0. torchmetrics v0.11.x gives the correct answer.

To Reproduce:

import torch
from torchmetrics.detection import MeanAveragePrecision

predictions = [dict(boxes=torch.tensor([[0.5, 0.5, 1, 1]]),
                    scores=torch.tensor([1.0]),
                    labels=torch.tensor([0]))]

targets = [dict(boxes=torch.tensor([[0, 0, 1, 1]]),
                labels=torch.tensor([0]))]

metric = MeanAveragePrecision(iou_thresholds=[0.2])
metric.update(predictions, targets)
result = metric.compute()  
result

@nisyad-ms nisyad-ms added bug / fix Something isn't working help wanted Extra attention is needed labels Jul 11, 2023
@github-actions
Copy link

Hi! thanks for your contribution!, great first issue!

@SkafteNicki SkafteNicki added this to the v1.1.0 milestone Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug / fix Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants