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

Revert MAP implementation to pycocotools backend #1832

Merged
merged 33 commits into from
Jul 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
9058fee
refactor
SkafteNicki Jun 8, 2023
48f3788
tests
SkafteNicki Jun 9, 2023
8055b8e
Merge branch 'master' into new_map
Borda Jun 12, 2023
b586a42
working reference
SkafteNicki Jun 13, 2023
b8c99e7
fix dtype casting
SkafteNicki Jun 13, 2023
13fd068
remove old code
SkafteNicki Jun 13, 2023
3c6f01c
improve docs
SkafteNicki Jun 13, 2023
46f1f8a
Merge branch 'master' into new_map
SkafteNicki Jun 13, 2023
6132051
changelog
SkafteNicki Jun 13, 2023
908f658
refactor
SkafteNicki Jun 13, 2023
fd21da0
fix doc formatting
SkafteNicki Jun 13, 2023
5efc562
Merge branch 'master' into new_map
SkafteNicki Jun 13, 2023
8c0a41d
mypy
SkafteNicki Jun 13, 2023
5f993e4
Merge branch 'master' into new_map
SkafteNicki Jun 13, 2023
8c6748d
Merge branch 'master' into new_map
SkafteNicki Jun 14, 2023
5651da0
skip doctest on missing import
SkafteNicki Jun 14, 2023
1e7bb62
remove helper
SkafteNicki Jun 15, 2023
188ff33
Merge branch 'master' into new_map
SkafteNicki Jun 19, 2023
dc875d9
fix tests
SkafteNicki Jun 21, 2023
2dec2db
fix tests
SkafteNicki Jun 21, 2023
19f8c56
Merge branch 'master' into new_map
SkafteNicki Jun 21, 2023
c1d665f
Merge branch 'master' into new_map
SkafteNicki Jun 22, 2023
fb3d0e7
Merge branch 'master' into new_map
SkafteNicki Jun 29, 2023
b6141dc
Merge branch 'master' into new_map
SkafteNicki Jun 29, 2023
b97eeb9
readd old implementation
SkafteNicki Jun 29, 2023
e910a6e
Merge branch 'new_map' of https://github.com/PyTorchLightning/metrics…
SkafteNicki Jun 29, 2023
3d244dc
Merge branch 'master' into new_map
SkafteNicki Jun 30, 2023
f5ba0fd
ignore mypy
SkafteNicki Jul 1, 2023
c1dfb27
Merge branch 'new_map' of https://github.com/PyTorchLightning/metrics…
SkafteNicki Jul 1, 2023
b75056d
Merge branch 'master' into new_map
SkafteNicki Jul 3, 2023
94587ad
Merge branch 'master' into new_map
mergify[bot] Jul 3, 2023
bad9952
Merge branch 'master' into new_map
mergify[bot] Jul 3, 2023
40823c4
Merge branch 'master' into new_map
mergify[bot] Jul 3, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Changed calculation in `PearsonCorrCoeff` to be more robust in certain cases ([#1729](https://github.com/Lightning-AI/torchmetrics/pull/1729))


- Changed `MeanAveragePrecision` to `pycocotools` backend ([#1832](https://github.com/Lightning-AI/torchmetrics/pull/1832))
SkafteNicki marked this conversation as resolved.
Show resolved Hide resolved


### Deprecated

- Deprecated domain metrics import from package root (
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ module = [
"torchmetrics.classification.roc",
"torchmetrics.classification.specificity",
"torchmetrics.classification.stat_scores",
"torchmetrics.detection._mean_ap",
"torchmetrics.detection.mean_ap",
"torchmetrics.functional.classification.calibration_error",
"torchmetrics.functional.classification.confusion_matrix",
Expand Down
970 changes: 970 additions & 0 deletions src/torchmetrics/detection/_mean_ap.py

Large diffs are not rendered by default.

1,112 changes: 441 additions & 671 deletions src/torchmetrics/detection/mean_ap.py

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion tests/unittests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@

import pytest
import torch
from torch.multiprocessing import Pool, set_start_method
from torch.multiprocessing import Pool, set_sharing_strategy, set_start_method

with contextlib.suppress(RuntimeError):
set_start_method("spawn")
set_sharing_strategy("file_system")

NUM_PROCESSES = 2 # torch.cuda.device_count() if torch.cuda.is_available() else 2
NUM_BATCHES = 2 * NUM_PROCESSES # Need to be divisible with the number of processes
Expand Down
3 changes: 3 additions & 0 deletions tests/unittests/detection/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@
from unittests import _PATH_ROOT

_SAMPLE_DETECTION_SEGMENTATION = os.path.join(_PATH_ROOT, "_data", "detection", "instance_segmentation_inputs.json")
_DETECTION_VAL = os.path.join(_PATH_ROOT, "_data", "detection", "instances_val2014_100.json")
_DETECTION_BBOX = os.path.join(_PATH_ROOT, "_data", "detection", "instances_val2014_fakebbox100_results.json")
_DETECTION_SEGM = os.path.join(_PATH_ROOT, "_data", "detection", "instances_val2014_fakesegm100_results.json")
Loading
Loading