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

Mean Average Detection ignores warn_on_many_detections set to False #2490

Closed
shatalinra opened this issue Apr 5, 2024 · 1 comment · Fixed by #2501
Closed

Mean Average Detection ignores warn_on_many_detections set to False #2490

shatalinra opened this issue Apr 5, 2024 · 1 comment · Fixed by #2501
Labels
bug / fix Something isn't working help wanted Extra attention is needed v1.3.x

Comments

@shatalinra
Copy link

🐛 Bug

MeanAverageDetection still outputs warning about too many detections even if warn_on_many_detections set to False.

To Reproduce

The existing unit test could be used for reproduction, just try to set field to False before running it:
https://github.com/Lightning-AI/torchmetrics/blob/master/tests/unittests/detection/test_map.py#L715
The test will detect that warning is still outputted and therefore test passes.

Expected behavior

Warnings are not outputted at all.

Environment

Conda environment with Python 3.10 and torchmetrics 1.3.1 installed into it using pip.
See additional context why further details about environment are not actually important.

Additional context

I looked through sources and already identified the issue: https://github.com/Lightning-AI/torchmetrics/blob/master/src/torchmetrics/detection/mean_ap.py#L803
Basically, warn parameter is never used inside function. Instead it should be a condition for triggering warning.
Also another unit test case for the flag being set to False could be useful.

@shatalinra shatalinra added bug / fix Something isn't working help wanted Extra attention is needed labels Apr 5, 2024
Copy link

github-actions bot commented Apr 5, 2024

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

@Borda Borda changed the title Mean Average Detection ignores warn_on_many_detections set to False Mean Average Detection ignores warn_on_many_detections set to False Apr 5, 2024
@Borda Borda added the v1.3.x label Apr 5, 2024
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 v1.3.x
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
@Borda @shatalinra and others