openvinotoolkit / anomalib

An anomaly detection library comprising state-of-the-art algorithms and features such as experiment management, hyper-parameter optimization, and edge inference.
https://anomalib.readthedocs.io/en/latest/
Apache License 2.0
3.69k stars 655 forks source link

add aupimo basic usage tutorial notebook #2330

Closed jpcbertoldo closed 2 days ago

jpcbertoldo commented 4 days ago

πŸ“ Description

add aupimo basic usage tutorial notebook

part of https://github.com/openvinotoolkit/anomalib/pull/2329

✨ Changes

Select what type of change your PR is:

βœ… Checklist

Before you submit your pull request, please make sure you have completed the following steps:

For more information about code review checklists, see the Code Review Checklist.

review-notebook-app[bot] commented 4 days ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

jpcbertoldo commented 4 days ago

@ashwinvaidya17

codecov[bot] commented 4 days ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 80.77%. Comparing base (8ff90a8) to head (e440725). Report is 1 commits behind head on feature/pimo.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## feature/pimo #2330 +/- ## ============================================= Coverage 80.77% 80.77% ============================================= Files 254 254 Lines 11463 11463 ============================================= Hits 9259 9259 Misses 2204 2204 ``` | [Flag](https://app.codecov.io/gh/openvinotoolkit/anomalib/pull/2330/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openvinotoolkit) | Coverage Ξ” | | |---|---|---| | [](https://app.codecov.io/gh/openvinotoolkit/anomalib/pull/2330/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openvinotoolkit) | `?` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openvinotoolkit#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

jpcbertoldo commented 3 days ago

I just update the datasets folder to be at anomalib/datasets instead of anomalib/notebooks/datasets so users won't get duplicates of mvtec. The other updates are just outputs from re-running the notebook. Ready to merge @samet-akcay

jpcbertoldo commented 3 days ago

It looks like an error in the CI environment?

https://github.com/openvinotoolkit/anomalib/actions/runs/11124854850/job/30912580676?pr=2330

bandit...................................................................Failed
- hook id: bandit
- exit code: 1

Traceback (most recent call last):
  File "/home/runner/.cache/pre-commit/repoikywl3ep/py_env-python3/bin/bandit", line 5, in <module>
    from bandit.cli.main import main
  File "/home/runner/.cache/pre-commit/repoikywl3ep/py_env-python3/lib/python3.10/site-packages/bandit/__init__.py", line 7, in <module>
    from bandit.core import config  # noqa
  File "/home/runner/.cache/pre-commit/repoikywl3ep/py_env-python3/lib/python3.10/site-packages/bandit/core/__init__.py", line 7, in <module>
    from bandit.core import manager  # noqa
  File "/home/runner/.cache/pre-commit/repoikywl3ep/py_env-python3/lib/python3.10/site-packages/bandit/core/manager.py", line 16, in <module>
    from rich import progress
  File "/home/runner/.cache/pre-commit/repoikywl3ep/py_env-python3/lib/python3.10/site-packages/rich/progress.py", line 45, in <module>
    from typing_extensions import Self  # pragma: no cover
ModuleNotFoundError: No module named 'typing_extensions'
jpcbertoldo commented 3 days ago

There is a new unrelated error in the CI, in the pre-merge checks. Looks like the environment is configed to use gpus but it is not available.

In src/anomalib/engine/engine.py:332 the Trainer is initialized with Trainer._cache.args that contains {'accelerator': 'gpu', ...}.

Later on, in _AcceleratorConnector.__init__ (lightning code) there is this

     @staticmethod
    def _choose_gpu_accelerator_backend() -> str:
        if MPSAccelerator.is_available():
            return "mps"
        if CUDAAccelerator.is_available():
            return "cuda"
>       raise MisconfigurationException("No supported gpu backend found!")
E       lightning.fabric.utilities.exceptions.MisconfigurationException: No supported gpu backend found!

which is causing the fail

samet-akcay commented 3 days ago

There is a new unrelated error in the CI, in the pre-merge checks. Looks like the environment is configed to use gpus but it is not available.

In src/anomalib/engine/engine.py:332 the Trainer is initialized with Trainer._cache.args that contains {'accelerator': 'gpu', ...}.

Later on, in _AcceleratorConnector.__init__ (lightning code) there is this

     @staticmethod
    def _choose_gpu_accelerator_backend() -> str:
        if MPSAccelerator.is_available():
            return "mps"
        if CUDAAccelerator.is_available():
            return "cuda"
>       raise MisconfigurationException("No supported gpu backend found!")
E       lightning.fabric.utilities.exceptions.MisconfigurationException: No supported gpu backend found!

which is causing the fail

I think docker needs restarting, @ashwinvaidya17 can do that tomorrow morning.