Skip to content

Commit

Permalink
metrics[0]: add per-image overlap (pimo) (#1247)
Browse files Browse the repository at this point in the history
* add per-image overlap (pimo)

* modif plot pimo curves

* add warning about memory

* tiny bug

* add tuto ipynb

* make image classes a return

* fix ipynb

* add tests for binclf curve

* add test to binclf

* add aupimo tests

* ruff

* Configure readthedocs via `.readthedocs.yaml` file (#1229)

* Update binclf_curve.py

* 🚚 Refactor Benchmarking Script (#1216)

* New printing stuff

* Remove dead code + address codacy issues

* Refactor try/except + log to comet/wandb during runs

* pre-commit error

* third-party configuration

---------

Co-authored-by: Ashwin Vaidya <[email protected]>

* Update CODEOWNERS

* Enable training with only normal images for MVTec (#1241)

* ignore mask check when dataset has only normal samples

* update changelog

* Revert "🚚 Refactor Benchmarking Script" (#1239)

Revert "🚚 Refactor Benchmarking Script (#1216)"

This reverts commit 784767f.

* Update benchmarking notebook (#1242)

* Fix metadata path

* Update benchmarking notebook

* add per-image overlap (pimo)

* modif plot pimo curves

* add warning about memory

* tiny bug

* add tuto ipynb

* make image classes a return

* fix ipynb

* add tests for binclf curve

* add test to binclf

* add aupimo tests

* ruff

* Update binclf_curve.py

* refactor from future pr

* correct tests

* add test

* fix test

* add plots tests

* correct codacy stuff

* correct codacy stuff

---------

Co-authored-by: Samet Akcay <[email protected]>
Co-authored-by: Ashwin Vaidya <[email protected]>
Co-authored-by: Ashwin Vaidya <[email protected]>
Co-authored-by: Dick Ameln <[email protected]>
  • Loading branch information
5 people authored Aug 23, 2023
1 parent f62fde0 commit 103c22c
Show file tree
Hide file tree
Showing 12 changed files with 2,122 additions and 1 deletion.
647 changes: 647 additions & 0 deletions notebooks/500_use_cases/502_perimg_metrics.ipynb

Large diffs are not rendered by default.

15 changes: 14 additions & 1 deletion src/anomalib/utils/metrics/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,22 @@
from .collection import AnomalibMetricCollection
from .min_max import MinMax
from .optimal_f1 import OptimalF1
from .perimg import AUPImO, PerImageBinClfCurve, PImO
from .pro import PRO

__all__ = ["AUROC", "AUPR", "AUPRO", "OptimalF1", "AnomalyScoreThreshold", "AnomalyScoreDistribution", "MinMax", "PRO"]
__all__ = [
"AUROC",
"AUPR",
"AUPRO",
"OptimalF1",
"AnomalyScoreThreshold",
"AnomalyScoreDistribution",
"MinMax",
"PRO",
"PerImageBinClfCurve",
"PImO",
"AUPImO",
]


def metric_collection_from_names(metric_names: list[str], prefix: str | None) -> AnomalibMetricCollection:
Expand Down
27 changes: 27 additions & 0 deletions src/anomalib/utils/metrics/perimg/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# temporary file to manage branches/PRs so they are simpler

fpr.py


tpr.py





slogroc.py


tpatfp.py



fp_requirement.py



precisionroc.py



scratch.py
15 changes: 15 additions & 0 deletions src/anomalib/utils/metrics/perimg/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"""Per-Image Metrics.
Overall approach:
Thresholds are computed across all images, but the metrics are computed per-image.
Metrics here are based on binary classification metrics (e.g. FPR, TPR, Precision) over a range of thresholds.
"""

from .binclf_curve import PerImageBinClfCurve
from .pimo import AUPImO, PImO

__all__ = [
"PerImageBinClfCurve",
"PImO",
"AUPImO",
]
Loading

0 comments on commit 103c22c

Please sign in to comment.