diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index bd349dcec5..08ab657373 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,56 +1,46 @@ // For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: // https://github.com/microsoft/vscode-dev-containers/tree/v0.187.0/containers/docker-existing-dockerfile { - "name": "Anomalib Development Environment", - // Sets the run context to one level up instead of the .devcontainer folder. - "context": "..", - // Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename. - "dockerFile": "../Dockerfile", - // Set *default* container specific settings.json values on container create. - "settings": { - "python.pythonPath": "/opt/conda/bin/python", - "python.formatting.provider": "black", - "editor.formatOnSave": true, - "python.formatting.blackArgs": [ - "--line-length", - "120" - ], - "editor.codeActionsOnSave": { - "source.organizeImports": true - }, - "python.linting.enabled": true, - "python.linting.flake8Enabled": true, - "python.linting.flake8Args": [ - "--max-line-length=120" - ], - "python.testing.cwd": ".", - "python.linting.lintOnSave": true, - "python.testing.unittestEnabled": false, - "python.testing.nosetestsEnabled": false, - "python.testing.pytestEnabled": true, - "python.testing.pytestArgs": [ - "tests" - ] - }, - // Add the IDs of extensions you want installed when the container is created. - "extensions": [ - "ms-python.python", - "njpwerner.autodocstring", - "streetsidesoftware.code-spell-checker", - "eamodio.gitlens", - "littlefoxteam.vscode-python-test-adapter" - ], - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - // Uncomment the next line to run commands after the container is created - for example installing curl. - // "postCreateCommand": "apt-get update && apt-get install -y curl", - // Uncomment when using a ptrace-based debugger like C++, Go, and Rust - "runArgs": [ - "--gpus=all", - "--shm-size=20g" - ] - // Uncomment to use the Docker CLI from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker. - // "mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ], - // Uncomment to connect as a non-root user if you've added one. See https://aka.ms/vscode-remote/containers/non-root. - // "remoteUser": "vscode" + "name": "Anomalib Development Environment", + // Sets the run context to one level up instead of the .devcontainer folder. + "context": "..", + // Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename. + "dockerFile": "../Dockerfile", + // Set *default* container specific settings.json values on container create. + "settings": { + "python.pythonPath": "/opt/conda/bin/python", + "python.formatting.provider": "black", + "editor.formatOnSave": true, + "python.formatting.blackArgs": ["--line-length", "120"], + "editor.codeActionsOnSave": { + "source.organizeImports": true + }, + "python.linting.enabled": true, + "python.linting.flake8Enabled": true, + "python.linting.flake8Args": ["--max-line-length=120"], + "python.testing.cwd": ".", + "python.linting.lintOnSave": true, + "python.testing.unittestEnabled": false, + "python.testing.nosetestsEnabled": false, + "python.testing.pytestEnabled": true, + "python.testing.pytestArgs": ["tests"] + }, + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "ms-python.python", + "njpwerner.autodocstring", + "streetsidesoftware.code-spell-checker", + "eamodio.gitlens", + "littlefoxteam.vscode-python-test-adapter" + ], + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + // Uncomment the next line to run commands after the container is created - for example installing curl. + // "postCreateCommand": "apt-get update && apt-get install -y curl", + // Uncomment when using a ptrace-based debugger like C++, Go, and Rust + "runArgs": ["--gpus=all", "--shm-size=20g"] + // Uncomment to use the Docker CLI from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker. + // "mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ], + // Uncomment to connect as a non-root user if you've added one. See https://aka.ms/vscode-remote/containers/non-root. + // "remoteUser": "vscode" } diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 947fd4eed3..2ab3790b9c 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,35 +1,40 @@ --- name: Bug report about: Create a report to help us improve -title: '' -labels: '' -assignees: '' - +title: "" +labels: "" +assignees: "" --- **Describe the bug** + - A clear and concise description of what the bug is. **To Reproduce** + Steps to reproduce the behavior: + 1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error +1. Click on '....' +1. Scroll down to '....' +1. See error **Expected behavior** + - A clear and concise description of what you expected to happen. **Screenshots** + - If applicable, add screenshots to help explain your problem. **Hardware and Software Configuration** + - OS: [Ubuntu, OD] - NVIDIA Driver Version [470.57.02] - CUDA Version [e.g. 11.4] - CUDNN Version [e.g. v11.4.120] - OpenVINO Version [Optional e.g. v2021.4.2] - **Additional context** + - Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index ea6f2c076e..2d66710054 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -1,20 +1,23 @@ --- name: Feature request about: Suggest an idea for this project -title: '' -labels: '' -assignees: '' - +title: "" +labels: "" +assignees: "" --- **Is your feature request related to a problem? Please describe.** - - A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] **Describe the solution you'd like** - - A clear and concise description of what you want to happen. + +- A clear and concise description of what you want to happen. **Describe alternatives you've considered** - - A clear and concise description of any alternative solutions or features you've considered. + +- A clear and concise description of any alternative solutions or features you've considered. **Additional context** - - Add any other context or screenshots about the feature request here. + +- Add any other context or screenshots about the feature request here. diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 54e6d7e3f1..c5a743e20b 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -7,6 +7,7 @@ ## Changes - [ ] Bug fix (non-breaking change which fixes an issue) +- [ ] Refactor (non-breaking change which refactors the code base) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update diff --git a/.mdlrc b/.mdlrc new file mode 100644 index 0000000000..840a3e398d --- /dev/null +++ b/.mdlrc @@ -0,0 +1 @@ +style "#{File.dirname(__FILE__)}/markdownlint.rb" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 07cd5892a0..63c79c6781 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,13 +22,6 @@ repos: hooks: - id: isort - # yaml formatting - - repo: https://github.com/pre-commit/mirrors-prettier - rev: v2.7.1 - hooks: - - id: prettier - types: [yaml] - # python code analysis - repo: https://github.com/PyCQA/flake8 rev: 4.0.1 @@ -76,3 +69,13 @@ repos: - id: nbqa-flake8 args: ["--max-line-length=120", "--ignore=E203,W503"] - id: nbqa-pylint + + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v2.7.1 + hooks: + - id: prettier + + - repo: https://github.com/jumanjihouse/pre-commit-hooks + rev: 2.1.6 + hooks: + - id: markdownlint diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b4e6477dc..a7d53ce60d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,215 +1,237 @@ # Changelog ## v.0.3.3 + ## What's Changed -* 🚚 Move initialization log message to base class by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/363 -* 🚚 Move logging from train.py to the getter functions by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/365 -* 🚜 Refactor loss computation by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/364 -* πŸ“ Add a technical blog post to explain how to run anomalib. by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/359 -* πŸ“š Add datamodule jupyter notebooks. by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/357 -* πŸ“ Add benchmarking notebook by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/353 -* βž• Add PyPI downloads badge to the readme. by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/370 -* πŸ“ƒ Update README.md by @innat in https://github.com/openvinotoolkit/anomalib/pull/382 -* πŸ’» Create Anomalib CLI by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/378 -* 🐞 Fix configs to remove logging heatmaps from classification models. by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/387 -* ✨ Add FastFlow model training testing inference via Anomalib API by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/386 -* 🐞 PaDim occasionally NaNs in anomaly map by @VdLMV in https://github.com/openvinotoolkit/anomalib/pull/392 -* πŸ–Ό Inference + Visualization by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/390 + +- 🚚 Move initialization log message to base class by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/363 +- 🚚 Move logging from train.py to the getter functions by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/365 +- 🚜 Refactor loss computation by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/364 +- πŸ“ Add a technical blog post to explain how to run anomalib. by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/359 +- πŸ“š Add datamodule jupyter notebooks. by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/357 +- πŸ“ Add benchmarking notebook by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/353 +- βž• Add PyPI downloads badge to the readme. by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/370 +- πŸ“ƒ Update README.md by @innat in https://github.com/openvinotoolkit/anomalib/pull/382 +- πŸ’» Create Anomalib CLI by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/378 +- 🐞 Fix configs to remove logging heatmaps from classification models. by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/387 +- ✨ Add FastFlow model training testing inference via Anomalib API by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/386 +- 🐞 PaDim occasionally NaNs in anomaly map by @VdLMV in https://github.com/openvinotoolkit/anomalib/pull/392 +- πŸ–Ό Inference + Visualization by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/390 New Contributors -* @innat made their first contribution in https://github.com/openvinotoolkit/anomalib/pull/382 -* @VdLMV made their first contribution in https://github.com/openvinotoolkit/anomalib/pull/392 + +- @innat made their first contribution in https://github.com/openvinotoolkit/anomalib/pull/382 +- @VdLMV made their first contribution in https://github.com/openvinotoolkit/anomalib/pull/392 **Full Changelog**: https://github.com/openvinotoolkit/anomalib/compare/v.0.3.2...v.0.3.3 ## v.0.3.2 + ## What's Changed -* Refactor `AnomalyModule` and `LightningModules` to explicitly define class arguments. by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/315 -* 🐞 Fix inferencer in Gradio by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/332 -* fix too many open images warning by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/334 -* Upgrade wandb version by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/340 -* Minor fix: Update folder dataset + notebooks link by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/338 -* Upgrade TorchMetrics version by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/342 -* πŸš€ Set pylint version in tox.ini by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/345 -* Add metrics configuration callback to benchmarking by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/346 -* βž• Add FastFlow Model by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/336 -* ✨ Add toy dataset to the repository by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/350 -* Add DRAEM Model by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/344 -* πŸ“ƒUpdate documentation by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/280 -* 🏷️ Refactor Datamodule names by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/354 -* ✨ Add Reverse Distillation by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/343 +- Refactor `AnomalyModule` and `LightningModules` to explicitly define class arguments. by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/315 +- 🐞 Fix inferencer in Gradio by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/332 +- fix too many open images warning by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/334 +- Upgrade wandb version by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/340 +- Minor fix: Update folder dataset + notebooks link by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/338 +- Upgrade TorchMetrics version by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/342 +- πŸš€ Set pylint version in tox.ini by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/345 +- Add metrics configuration callback to benchmarking by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/346 +- βž• Add FastFlow Model by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/336 +- ✨ Add toy dataset to the repository by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/350 +- Add DRAEM Model by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/344 +- πŸ“ƒUpdate documentation by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/280 +- 🏷️ Refactor Datamodule names by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/354 +- ✨ Add Reverse Distillation by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/343 **Full Changelog**: https://github.com/openvinotoolkit/anomalib/compare/v.0.3.1...v.0.3.2 ## v.0.3.1 + ## What's Changed -* πŸ”§ Properly assign values to dataframe in folder dataset. by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/272 -* βž• Add warnings ⚠️ for inproper task setting in config files. by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/274 -* Updated CHANGELOG.md by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/276 -* βž• Add long description to `setup.py` to make `README.md` PyPI friendly. by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/279 -* ✨ Add hash check to data download by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/284 -* βž• Add Gradio by @julien-blanchon in https://github.com/openvinotoolkit/anomalib/pull/283 -* πŸ”¨ Fix nncf key issue in nightly job by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/238 -* Visualizer improvements pt1 by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/293 -* πŸ§ͺ Fix nightly by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/299 -* πŸ§ͺ Add tests for benchmarking script by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/297 -* βž• add input_info to nncf config when not defined by user by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/307 -* 🐞 Increase tolerance + nightly path fix by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/318 -* βž• Add jupyter notebooks directory and first tutorial for `getting-started` by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/292 + +- πŸ”§ Properly assign values to dataframe in folder dataset. by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/272 +- βž• Add warnings ⚠️ for inproper task setting in config files. by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/274 +- Updated CHANGELOG.md by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/276 +- βž• Add long description to `setup.py` to make `README.md` PyPI friendly. by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/279 +- ✨ Add hash check to data download by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/284 +- βž• Add Gradio by @julien-blanchon in https://github.com/openvinotoolkit/anomalib/pull/283 +- πŸ”¨ Fix nncf key issue in nightly job by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/238 +- Visualizer improvements pt1 by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/293 +- πŸ§ͺ Fix nightly by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/299 +- πŸ§ͺ Add tests for benchmarking script by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/297 +- βž• add input_info to nncf config when not defined by user by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/307 +- 🐞 Increase tolerance + nightly path fix by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/318 +- βž• Add jupyter notebooks directory and first tutorial for `getting-started` by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/292 New Contributors -* @julien-blanchon made their first contribution in https://github.com/openvinotoolkit/anomalib/pull/283 + +- @julien-blanchon made their first contribution in https://github.com/openvinotoolkit/anomalib/pull/283 **Full Changelog**: https://github.com/openvinotoolkit/anomalib/compare/v0.3.0...v.0.3.1 ## v.0.3.0 + ### What's Changed -* πŸ›  ⚠️ Fix configs to properly use pytorch-lightning==1.6 with GPU by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/234 -* πŸ›  Fix `get_version` in `setup.py` to avoid hard-coding version. by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/229 -* 🐞 Fix image loggers by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/233 -* Configurable metrics by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/230 -* Make OpenVINO throughput optional in benchmarking by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/239 -* πŸ”¨ Minor fix: Ensure docs build runs only on isea-server by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/245 -* 🏷 Rename `--model_config_path` to `config` by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/246 -* Revert "🏷 Rename `--model_config_path` to `config`" by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/247 -* βž• Add `--model_config_path` deprecation warning to `inference.py` by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/248 -* Add console logger by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/241 -* Add segmentation mask to inference output by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/242 -* πŸ›  Fix broken mvtec link, and split url to fit to 120 by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/264 -* πŸ›  Fix mask filenames in folder dataset by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/249 +- πŸ›  ⚠️ Fix configs to properly use pytorch-lightning==1.6 with GPU by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/234 +- πŸ›  Fix `get_version` in `setup.py` to avoid hard-coding version. by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/229 +- 🐞 Fix image loggers by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/233 +- Configurable metrics by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/230 +- Make OpenVINO throughput optional in benchmarking by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/239 +- πŸ”¨ Minor fix: Ensure docs build runs only on isea-server by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/245 +- 🏷 Rename `--model_config_path` to `config` by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/246 +- Revert "🏷 Rename `--model_config_path` to `config`" by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/247 +- βž• Add `--model_config_path` deprecation warning to `inference.py` by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/248 +- Add console logger by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/241 +- Add segmentation mask to inference output by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/242 +- πŸ›  Fix broken mvtec link, and split url to fit to 120 by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/264 +- πŸ›  Fix mask filenames in folder dataset by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/249 **Full Changelog**: https://github.com/openvinotoolkit/anomalib/compare/v0.2.6...v0.3.0 + ## v.0.2.6 + ### What's Changed -* ✏️ Add `torchtext==0.9.1` to support Kaggle environments. by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/165 -* πŸ›  Fix `KeyError:'label'` in classification folder dataset by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/175 -* πŸ“ Added MVTec license to the repo by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/177 -* load best model from checkpoint by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/195 -* Replace `SaveToCSVCallback` with PL `CSVLogger` by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/198 -* WIP Refactor test by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/197 -* πŸ”§ Dockerfile enhancements by @LukasBommes in https://github.com/openvinotoolkit/anomalib/pull/172 -* πŸ›  Fix visualization issue for fully defected images by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/194 -* ✨ Add hpo search using `wandb` by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/82 -* Separate train and validation transformations by @alexriedel1 in https://github.com/openvinotoolkit/anomalib/pull/168 -* πŸ›  Fix docs workflow by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/200 -* πŸ”„ CFlow: Switch soft permutation to false by default to speed up training. by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/201 -* Return only `image`, `path` and `label` for classification tasks in `Mvtec` and `Btech` datasets. by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/196 -* πŸ—‘ Remove `freia` as dependency and include it in `anomalib/models/components` by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/174 -* Visualizer show classification and segmentation by @alexriedel1 in https://github.com/openvinotoolkit/anomalib/pull/178 -* ↗️ Bump up `pytorch-lightning` version to `1.6.0` or higher by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/193 -* πŸ›  Refactor DFKDE model by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/207 -* πŸ›  Minor fixes: Update callbacks to AnomalyModule by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/208 -* πŸ›  Minor update: Update pre-commit docs by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/206 -* ✨ Directory streaming by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/210 -* ✏️ Updated documentation for development on Docker by @LukasBommes in https://github.com/openvinotoolkit/anomalib/pull/217 -* 🏷 Fix Mac M1 dependency conflicts by @dreaquil in https://github.com/openvinotoolkit/anomalib/pull/158 -* 🐞 Set tiling off in pathcore to correctly reproduce the stats. by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/222 -* 🐞fix support for non-square images by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/204 -* Allow specifying feature layer and pool factor in DFM by @nahuja-intel in https://github.com/openvinotoolkit/anomalib/pull/215 -* πŸ“ Add GANomaly metrics to readme by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/224 -* ↗️ Bump the version to 0.2.6 by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/223 -* πŸ“ πŸ›  Fix inconsistent benchmarking throughput/time by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/221 -* assign test split for folder dataset by @alexriedel1 in https://github.com/openvinotoolkit/anomalib/pull/220 -* πŸ›  Refactor model implementations by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/225 + +- ✏️ Add `torchtext==0.9.1` to support Kaggle environments. by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/165 +- πŸ›  Fix `KeyError:'label'` in classification folder dataset by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/175 +- πŸ“ Added MVTec license to the repo by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/177 +- load best model from checkpoint by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/195 +- Replace `SaveToCSVCallback` with PL `CSVLogger` by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/198 +- WIP Refactor test by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/197 +- πŸ”§ Dockerfile enhancements by @LukasBommes in https://github.com/openvinotoolkit/anomalib/pull/172 +- πŸ›  Fix visualization issue for fully defected images by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/194 +- ✨ Add hpo search using `wandb` by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/82 +- Separate train and validation transformations by @alexriedel1 in https://github.com/openvinotoolkit/anomalib/pull/168 +- πŸ›  Fix docs workflow by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/200 +- πŸ”„ CFlow: Switch soft permutation to false by default to speed up training. by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/201 +- Return only `image`, `path` and `label` for classification tasks in `Mvtec` and `Btech` datasets. by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/196 +- πŸ—‘ Remove `freia` as dependency and include it in `anomalib/models/components` by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/174 +- Visualizer show classification and segmentation by @alexriedel1 in https://github.com/openvinotoolkit/anomalib/pull/178 +- ↗️ Bump up `pytorch-lightning` version to `1.6.0` or higher by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/193 +- πŸ›  Refactor DFKDE model by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/207 +- πŸ›  Minor fixes: Update callbacks to AnomalyModule by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/208 +- πŸ›  Minor update: Update pre-commit docs by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/206 +- ✨ Directory streaming by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/210 +- ✏️ Updated documentation for development on Docker by @LukasBommes in https://github.com/openvinotoolkit/anomalib/pull/217 +- 🏷 Fix Mac M1 dependency conflicts by @dreaquil in https://github.com/openvinotoolkit/anomalib/pull/158 +- 🐞 Set tiling off in pathcore to correctly reproduce the stats. by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/222 +- 🐞fix support for non-square images by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/204 +- Allow specifying feature layer and pool factor in DFM by @nahuja-intel in https://github.com/openvinotoolkit/anomalib/pull/215 +- πŸ“ Add GANomaly metrics to readme by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/224 +- ↗️ Bump the version to 0.2.6 by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/223 +- πŸ“ πŸ›  Fix inconsistent benchmarking throughput/time by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/221 +- assign test split for folder dataset by @alexriedel1 in https://github.com/openvinotoolkit/anomalib/pull/220 +- πŸ›  Refactor model implementations by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/225 New Contributors -* @LukasBommes made their first contribution in https://github.com/openvinotoolkit/anomalib/pull/172 -* @dreaquil made their first contribution in https://github.com/openvinotoolkit/anomalib/pull/158 -* @nahuja-intel made their first contribution in https://github.com/openvinotoolkit/anomalib/pull/215 + +- @LukasBommes made their first contribution in https://github.com/openvinotoolkit/anomalib/pull/172 +- @dreaquil made their first contribution in https://github.com/openvinotoolkit/anomalib/pull/158 +- @nahuja-intel made their first contribution in https://github.com/openvinotoolkit/anomalib/pull/215 **Full Changelog**: https://github.com/openvinotoolkit/anomalib/compare/v.0.2.5...v0.2.6 + ## v.0.2.5 + ### What's Changed -* Bugfix: fix random val/test split issue by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/48 -* Fix Readmes by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/46 -* Updated changelog by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/49 -* add distinction between image and pixel threshold in postprocessor by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/50 -* Fix docstrings by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/22 -* Fix networkx requirement by @LeonidBeynenson in https://github.com/openvinotoolkit/anomalib/pull/52 -* Add min-max normalization by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/53 -* Change hardcoded dataset path to environ variable by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/51 -* Added cflow algorithm by @blakshma in https://github.com/openvinotoolkit/anomalib/pull/47 -* perform metric computation on cpu by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/64 -* Fix Inferencer by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/60 -* Updated readme for cflow and change default config to reflect results by @blakshma in https://github.com/openvinotoolkit/anomalib/pull/68 -* Fixed issue with model loading by @blakshma in https://github.com/openvinotoolkit/anomalib/pull/69 -* Docs/sa/fix readme by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/71 -* Updated coreset subsampling method to improve accuracy by @blakshma in https://github.com/openvinotoolkit/anomalib/pull/73 -* Revert "Updated coreset subsampling method to improve accuracy" by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/79 -* Replace `SupportIndex` with `int` by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/76 -* Added reference to official CFLOW repo by @blakshma in https://github.com/openvinotoolkit/anomalib/pull/81 -* Fixed issue with k_greedy method by @blakshma in https://github.com/openvinotoolkit/anomalib/pull/80 -* Fix Mix Data type issue on inferencer by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/77 -* Create CODE_OF_CONDUCT.md by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/86 -* ✨ Add GANomaly by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/70 -* Reorder auc only when needed by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/91 -* Bump up the pytorch lightning to master branch due to vulnurability issues by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/55 -* πŸš€ CI: Nightly Build by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/66 -* Refactor by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/87 -* Benchmarking Script by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/17 -* 🐞 Fix tensor detach and gpu count issues in benchmarking script by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/100 -* Return predicted masks in predict step by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/103 -* Add Citation to the Readme by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/106 -* Nightly build by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/104 -* c_idx cast to LongTensor in random sparse projection by @alexriedel1 in https://github.com/openvinotoolkit/anomalib/pull/113 -* Update Nightly by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/126 -* Updated logos by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/131 -* Add third-party-programs.txt file and update license by @LeonidBeynenson in https://github.com/openvinotoolkit/anomalib/pull/132 -* πŸ”¨ Increase inference + openvino support by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/122 -* Fix/da/image size bug by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/135 -* Fix/da/image size bug by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/140 -* optimize compute_anomaly_score by using torch native funcrtions by @alexriedel1 in https://github.com/openvinotoolkit/anomalib/pull/141 -* Fix IndexError in adaptive threshold computation by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/146 -* Feature/data/btad by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/120 -* Update for nncf_task by @AlexanderDokuchaev in https://github.com/openvinotoolkit/anomalib/pull/145 -* fix non-adaptive thresholding bug by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/152 -* Calculate feature map shape patchcore by @alexriedel1 in https://github.com/openvinotoolkit/anomalib/pull/148 -* Add `transform_config` to the main `config.yaml` file. by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/156 -* Add Custom Dataset Training Support by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/154 -* Added extension as an option when saving the result images. by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/162 -* Update `anomalib` version and requirements by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/163 + +- Bugfix: fix random val/test split issue by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/48 +- Fix Readmes by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/46 +- Updated changelog by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/49 +- add distinction between image and pixel threshold in postprocessor by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/50 +- Fix docstrings by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/22 +- Fix networkx requirement by @LeonidBeynenson in https://github.com/openvinotoolkit/anomalib/pull/52 +- Add min-max normalization by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/53 +- Change hardcoded dataset path to environ variable by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/51 +- Added cflow algorithm by @blakshma in https://github.com/openvinotoolkit/anomalib/pull/47 +- perform metric computation on cpu by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/64 +- Fix Inferencer by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/60 +- Updated readme for cflow and change default config to reflect results by @blakshma in https://github.com/openvinotoolkit/anomalib/pull/68 +- Fixed issue with model loading by @blakshma in https://github.com/openvinotoolkit/anomalib/pull/69 +- Docs/sa/fix readme by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/71 +- Updated coreset subsampling method to improve accuracy by @blakshma in https://github.com/openvinotoolkit/anomalib/pull/73 +- Revert "Updated coreset subsampling method to improve accuracy" by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/79 +- Replace `SupportIndex` with `int` by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/76 +- Added reference to official CFLOW repo by @blakshma in https://github.com/openvinotoolkit/anomalib/pull/81 +- Fixed issue with k_greedy method by @blakshma in https://github.com/openvinotoolkit/anomalib/pull/80 +- Fix Mix Data type issue on inferencer by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/77 +- Create CODE_OF_CONDUCT.md by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/86 +- ✨ Add GANomaly by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/70 +- Reorder auc only when needed by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/91 +- Bump up the pytorch lightning to master branch due to vulnurability issues by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/55 +- πŸš€ CI: Nightly Build by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/66 +- Refactor by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/87 +- Benchmarking Script by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/17 +- 🐞 Fix tensor detach and gpu count issues in benchmarking script by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/100 +- Return predicted masks in predict step by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/103 +- Add Citation to the Readme by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/106 +- Nightly build by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/104 +- c_idx cast to LongTensor in random sparse projection by @alexriedel1 in https://github.com/openvinotoolkit/anomalib/pull/113 +- Update Nightly by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/126 +- Updated logos by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/131 +- Add third-party-programs.txt file and update license by @LeonidBeynenson in https://github.com/openvinotoolkit/anomalib/pull/132 +- πŸ”¨ Increase inference + openvino support by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/122 +- Fix/da/image size bug by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/135 +- Fix/da/image size bug by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/140 +- optimize compute_anomaly_score by using torch native funcrtions by @alexriedel1 in https://github.com/openvinotoolkit/anomalib/pull/141 +- Fix IndexError in adaptive threshold computation by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/146 +- Feature/data/btad by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/120 +- Update for nncf_task by @AlexanderDokuchaev in https://github.com/openvinotoolkit/anomalib/pull/145 +- fix non-adaptive thresholding bug by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/152 +- Calculate feature map shape patchcore by @alexriedel1 in https://github.com/openvinotoolkit/anomalib/pull/148 +- Add `transform_config` to the main `config.yaml` file. by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/156 +- Add Custom Dataset Training Support by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/154 +- Added extension as an option when saving the result images. by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/162 +- Update `anomalib` version and requirements by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/163 New Contributors -* @LeonidBeynenson made their first contribution in https://github.com/openvinotoolkit/anomalib/pull/52 -* @blakshma made their first contribution in https://github.com/openvinotoolkit/anomalib/pull/47 -* @alexriedel1 made their first contribution in https://github.com/openvinotoolkit/anomalib/pull/113 -* @AlexanderDokuchaev made their first contribution in https://github.com/openvinotoolkit/anomalib/pull/145 + +- @LeonidBeynenson made their first contribution in https://github.com/openvinotoolkit/anomalib/pull/52 +- @blakshma made their first contribution in https://github.com/openvinotoolkit/anomalib/pull/47 +- @alexriedel1 made their first contribution in https://github.com/openvinotoolkit/anomalib/pull/113 +- @AlexanderDokuchaev made their first contribution in https://github.com/openvinotoolkit/anomalib/pull/145 **Full Changelog**: https://github.com/openvinotoolkit/anomalib/compare/v.0.2.4...v.0.2.5 + ## v.0.2.4 + ### What's Changed -* Bump up the version to 0.2.4 by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/45 -* fix heatmap color scheme by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/44 + +- Bump up the version to 0.2.4 by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/45 +- fix heatmap color scheme by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/44 **Full Changelog**: https://github.com/openvinotoolkit/anomalib/compare/v.0.2.3...v.0.2.4 ## v.0.2.3 + ### What's Changed -* Address docs build failing issue by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/39 -* Fix docs pipeline πŸ“„ by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/41 -* Feature/dick/anomaly score normalization by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/35 -* Shuffle train dataloader by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/42 +- Address docs build failing issue by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/39 +- Fix docs pipeline πŸ“„ by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/41 +- Feature/dick/anomaly score normalization by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/35 +- Shuffle train dataloader by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/42 **Full Changelog**: https://github.com/openvinotoolkit/anomalib/compare/v0.2.2...v.0.2.3 ## v0.2.0 Pre-release (2021-12-15) + ### What's Changed -* Address compatibility issues with OTE, that are caused by the legacy code. by @samet-akcay in [#24](https://github.com/openvinotoolkit/anomalib/pull/24) -* Initial docs string by @ashwinvaidya17 in [#9](https://github.com/openvinotoolkit/anomalib/pull/9) -* Load model did not work correctly as DFMModel did not inherit by @ashwinvaidya17 in [#5](https://github.com/openvinotoolkit/anomalib/pull/5) -* Refactor/samet/data by @samet-akcay in [#8](https://github.com/openvinotoolkit/anomalib/pull/8) -* Delete make.bat by @samet-akcay in [#11](https://github.com/openvinotoolkit/anomalib/pull/11) -* TorchMetrics by @djdameln in [#7](https://github.com/openvinotoolkit/anomalib/pull/7) -* ONNX node naming by @djdameln in [#13](https://github.com/openvinotoolkit/anomalib/pull/13) -* Add FPS counter to `TimerCallback` by @ashwinvaidya17 in [#12](https://github.com/openvinotoolkit/anomalib/pull/12) +- Address compatibility issues with OTE, that are caused by the legacy code. by @samet-akcay in [#24](https://github.com/openvinotoolkit/anomalib/pull/24) +- Initial docs string by @ashwinvaidya17 in [#9](https://github.com/openvinotoolkit/anomalib/pull/9) +- Load model did not work correctly as DFMModel did not inherit by @ashwinvaidya17 in [#5](https://github.com/openvinotoolkit/anomalib/pull/5) +- Refactor/samet/data by @samet-akcay in [#8](https://github.com/openvinotoolkit/anomalib/pull/8) +- Delete make.bat by @samet-akcay in [#11](https://github.com/openvinotoolkit/anomalib/pull/11) +- TorchMetrics by @djdameln in [#7](https://github.com/openvinotoolkit/anomalib/pull/7) +- ONNX node naming by @djdameln in [#13](https://github.com/openvinotoolkit/anomalib/pull/13) +- Add FPS counter to `TimerCallback` by @ashwinvaidya17 in [#12](https://github.com/openvinotoolkit/anomalib/pull/12) Contributors -* @ashwinvaidya17 -* @djdameln -* @samet-akcay + +- @ashwinvaidya17 +- @djdameln +- @samet-akcay **Full Changelog**: https://github.com/openvinotoolkit/anomalib/commits/v0.2.0 diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 9502342064..44eab4c3b5 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -17,23 +17,23 @@ diverse, inclusive, and healthy community. Examples of behavior that contributes to a positive environment for our community include: -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, +- Demonstrating empathy and kindness toward other people +- Being respectful of differing opinions, viewpoints, and experiences +- Giving and gracefully accepting constructive feedback +- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience -* Focusing on what is best not just for us as individuals, but for the +- Focusing on what is best not just for us as individuals, but for the overall community Examples of unacceptable behavior include: -* The use of sexualized language or imagery, and sexual attention or +- The use of sexualized language or imagery, and sexual attention or advances of any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or email +- Trolling, insulting or derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or email address, without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a +- Other conduct which could reasonably be considered inappropriate in a professional setting ## Enforcement Responsibilities @@ -106,7 +106,7 @@ Violating these terms may lead to a permanent ban. ### 4. Permanent Ban **Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an +standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. **Consequence**: A permanent ban from any sort of public interaction within diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 90a2cc69d0..66a2fd02b0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,4 +1,5 @@ # Contributing to Anomalib + We welcome your input! πŸ‘ We want to make it as simple and straightforward as possible to contribute to this project, whether it is a: @@ -9,32 +10,33 @@ We want to make it as simple and straightforward as possible to contribute to th - Creating a Pull Request (PR) - Becoming a maintainer - ## Bug Report -We use GitHub issues to track the bugs. Report a bug by using our Bug Report Template in [Issues](https://github.com/openvinotoolkit/anomalib/issues/new?assignees=&labels=&template=bug_report.md). +We use GitHub issues to track the bugs. Report a bug by using our Bug Report Template in [Issues](https://github.com/openvinotoolkit/anomalib/issues/new?assignees=&labels=&template=bug_report.md). ## Discussion -We enabled [GitHub Discussions](https://github.com/openvinotoolkit/anomalib/discussions/) in anomalib to welcome the community to ask questions and/or propose ideas/solutions. This will not only provide a medium to the community to discuss about anomalib but also help us de-clutter [Issues](https://github.com/openvinotoolkit/anomalib/issues/new?assignees=&labels=&template=bug_report.md). +We enabled [GitHub Discussions](https://github.com/openvinotoolkit/anomalib/discussions/) in anomalib to welcome the community to ask questions and/or propose ideas/solutions. This will not only provide a medium to the community to discuss about anomalib but also help us de-clutter [Issues](https://github.com/openvinotoolkit/anomalib/issues/new?assignees=&labels=&template=bug_report.md). ## Feature Request -We utilize GitHub issues to track the feature requests as well. If you are certain regarding the feature you are interested and have a solid proposal, you could then create the feature request by using our [Feature Request Template](https://github.com/openvinotoolkit/anomalib/issues/new?assignees=&labels=&template=feature_request.md) in Issues. If it's still in an idea phase, you could then discuss that with the community in our [Discussion](https://github.com/openvinotoolkit/anomalib/discussions/categories/ideas). +We utilize GitHub issues to track the feature requests as well. If you are certain regarding the feature you are interested and have a solid proposal, you could then create the feature request by using our [Feature Request Template](https://github.com/openvinotoolkit/anomalib/issues/new?assignees=&labels=&template=feature_request.md) in Issues. If it's still in an idea phase, you could then discuss that with the community in our [Discussion](https://github.com/openvinotoolkit/anomalib/discussions/categories/ideas). ## Development & PRs + We actively welcome your pull requests: - 1. Fork the repo and create your branch from [`development`](https://github.com/openvinotoolkit/anomalib/tree/development). - 2. If you've added code that should be tested, add tests. - 3. If you've changed APIs, update the documentation. - 4. Ensure the test suite passes. - 5. Make sure your code lints. - 6. Make sure you own the code you're submitting or that you obtain it from a source with an appropriate license. - 7. Issue that pull request! +1. Fork the repo and create your branch from [`development`](https://github.com/openvinotoolkit/anomalib/tree/development). +1. If you've added code that should be tested, add tests. +1. If you've changed APIs, update the documentation. +1. Ensure the test suite passes. +1. Make sure your code lints. +1. Make sure you own the code you're submitting or that you obtain it from a source with an appropriate license. +1. Issue that pull request! To setup the development environment, you will need to install development requirements. -``` + +```bash pip install -r requirements/dev.txt ``` @@ -55,10 +57,10 @@ Instead of running each of these tools manually, we automatically run them befor In rare cases it might be desired to ignore certain errors or warnings for a particular part of your code. Flake8, Pylint and MyPy allow disabling specific errors for a line or block of code. The instructions for this can be found in the the documentations of each of these tools. Please make sure to only ignore errors/warnings when absolutely necessary, and always add a comment in your code stating why you chose to ignore it. - ## License -You accept that your contributions will be licensed under the [Apache-2.0 License](https://choosealicense.com/licenses/apache-2.0/) if you contribute to this repository. If this is a concern, please notify the maintainers. +You accept that your contributions will be licensed under the [Apache-2.0 License](https://choosealicense.com/licenses/apache-2.0/) if you contribute to this repository. If this is a concern, please notify the maintainers. ## References + This document was adapted from [here](https://gist.github.com/briandk/3d2e8b3ec8daf5a27a62). diff --git a/README.md b/README.md index 98d761e0f4..c0a52fc5bb 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,8 @@ **A library for benchmarking, developing and deploying deep learning anomaly detection algorithms** -___ + +--- [Key Features](#key-features) β€’ [Getting Started](#getting-started) β€’ @@ -18,11 +19,12 @@ ___ [![Pre-merge Checks](https://github.com/openvinotoolkit/anomalib/actions/workflows/pre_merge.yml/badge.svg)](https://github.com/openvinotoolkit/anomalib/actions/workflows/pre_merge.yml) [![Build Docs](https://github.com/openvinotoolkit/anomalib/actions/workflows/docs.yml/badge.svg)](https://github.com/openvinotoolkit/anomalib/actions/workflows/docs.yml) [![Downloads](https://static.pepy.tech/personalized-badge/anomalib?period=total&units=international_system&left_color=grey&right_color=green&left_text=PyPI%20Downloads)](https://pepy.tech/project/anomalib) + -___ +--- -## Introduction +# Introduction Anomalib is a deep learning library that aims to collect state-of-the-art anomaly detection algorithms for benchmarking on both public and private datasets. Anomalib provides several ready-to-use implementations of anomaly detection algorithms described in the recent literature, as well as a set of tools that facilitate the development and implementation of custom models. The library has a strong focus on image-based anomaly detection, where the goal of the algorithm is to identify anomalous images, or anomalous pixel regions within images in a dataset. Anomalib is constantly updated with new algorithms and training/inference extensions, so keep checking! @@ -35,13 +37,13 @@ Anomalib is a deep learning library that aims to collect state-of-the-art anomal - All models can be exported to [**OpenVINO**](https://www.intel.com/content/www/us/en/developer/tools/openvino-toolkit/overview.html) Intermediate Representation (IR) for accelerated inference on intel hardware. - A set of [inference tools](#inference) for quick and easy deployment of the standard or custom anomaly detection models. -___ +--- -## Getting Started +# Getting Started To get an overview of all the devices where `anomalib` as been tested thoroughly, look at the [Supported Hardware](https://openvinotoolkit.github.io/anomalib/#supported-hardware) section in the documentation. -### Jupyter Notebooks +## Jupyter Notebooks For getting started with a Jupyter Notebook, please refer to the [Notebooks](./notebooks) folder of this repository. Additionally, you can refer to a few created by the community: @@ -49,7 +51,7 @@ For getting started with a Jupyter Notebook, please refer to the [Notebooks](./n by [@innat](https://github.com/innat) -### PyPI Install +## PyPI Install You can get started with `anomalib` by just using pip. @@ -57,7 +59,8 @@ You can get started with `anomalib` by just using pip. pip install anomalib ``` -### Local Install +## Local Install + It is highly recommended to use virtual environment when installing anomalib. For instance, with [anaconda](https://www.anaconda.com/products/individual), `anomalib` could be installed as, ```bash @@ -68,11 +71,12 @@ cd anomalib pip install -e . ``` -## Training -### ⚠️ Anomalib < v.0.4.0 +# Training + +## ⚠️ Anomalib < v.0.4.0 By default [`python tools/train.py`](https://gitlab-icv.inn.intel.com/algo_rnd_team/anomaly/-/blob/development/train.py) -runs [PADIM](https://arxiv.org/abs/2011.08785) model on `leather` category from the [MVTec AD](https://www.mvtec.com/company/research/datasets/mvtec-ad) [(CC BY-NC-SA 4.0)](https://creativecommons.org/licenses/by-nc-sa/4.0/) dataset. +runs [PADIM](https://arxiv.org/abs/2011.08785) model on `leather` category from the [MVTec AD](https://www.mvtec.com/company/research/datasets/mvtec-ad) [(CC BY-NC-SA 4.0)](https://creativecommons.org/licenses/by-nc-sa/4.0/) dataset. ```bash python tools/train.py # Train PADIM on MVTec AD leather @@ -110,8 +114,10 @@ where the currently available models are: - [STFPM](anomalib/models/stfpm) - [GANomaly](anomalib/models/ganomaly) -### Custom Dataset +## Custom Dataset + It is also possible to train on a custom folder dataset. To do so, `data` section in `config.yaml` is to be modified as follows: + ```yaml dataset: name: @@ -123,7 +129,7 @@ dataset: task: segmentation # classification or segmentation mask: #optional extensions: null - split_ratio: 0.2 # ratio of the normal images that will be used to create a test split + split_ratio: 0.2 # ratio of the normal images that will be used to create a test split image_size: 256 train_batch_size: 32 test_batch_size: 32 @@ -141,21 +147,26 @@ dataset: random_tile_count: 16 ``` -### ⚠️ Anomalib > v.0.4.0 Beta - Subject to Change +## ⚠️ Anomalib > v.0.4.0 Beta - Subject to Change + We introduce a new CLI approach that uses [PyTorch Lightning CLI](https://pytorch-lightning.readthedocs.io/en/stable/common/lightning_cli.html). To train a model using the new CLI, one would call the following: + ```bash anomalib fit --config ``` For instance, to train a [PatchCore](https://github.com/openvinotoolkit/anomalib/tree/development/anomalib/models/patchcore) model, the following command would be run: + ```bash anomalib fit --config ./configs/model/patchcore.yaml ``` The new CLI approach offers a lot more flexibility, details of which are explained in the [documentation](https://pytorch-lightning.readthedocs.io/en/stable/common/lightning_cli.html). -## Inference -### ⚠️ Anomalib < v.0.4.0 +# Inference + +## ⚠️ Anomalib < v.0.4.0 + Anomalib includes multiple tools, including Lightning, Gradio, and OpenVINO inferencers, for performing inference with a trained model. The following command can be used to run PyTorch Lightning inference from the command line: @@ -205,7 +216,7 @@ python tools/inference/gradio_inference.py \ --weights ./results/padim/mvtec/bottle/weights/model.ckpt ``` -## Hyperparameter Optimization +# Hyperparameter Optimization To run hyperparameter optimization, use the following command: @@ -217,7 +228,7 @@ python tools/hpo/sweep.py \ For more details refer the [HPO Documentation](https://openvinotoolkit.github.io/anomalib/guides/hyperparameter_optimization.html) -## Benchmarking +# Benchmarking To gather benchmarking data such as throughput across categories, use the following command: @@ -228,7 +239,7 @@ python tools/benchmarking/benchmark.py \ Refer to the [Benchmarking Documentation](https://openvinotoolkit.github.io/anomalib/guides/benchmarking.html) for more details. -## Logging Images +# Logging Images You can save images locally or to a logger such TensorBoard or Weights and Biases by setting the following configuration. @@ -239,18 +250,19 @@ logging: ``` For more information on logging images, refer to the [Logging Documentation](https://openvinotoolkit.github.io/anomalib/guides/logging.html) -___ -## Datasets +--- + +# Datasets `anomalib` supports MVTec AD [(CC BY-NC-SA 4.0)](https://creativecommons.org/licenses/by-nc-sa/4.0/) and BeanTech [(CC-BY-SA)](https://creativecommons.org/licenses/by-sa/4.0/legalcode) for benchmarking and `folder` for custom dataset training/inference. -### [MVTec AD Dataset](https://www.mvtec.com/company/research/datasets/mvtec-ad) +## [MVTec AD Dataset](https://www.mvtec.com/company/research/datasets/mvtec-ad) MVTec AD dataset is one of the main benchmarks for anomaly detection, and is released under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License [(CC BY-NC-SA 4.0)](https://creativecommons.org/licenses/by-nc-sa/4.0/). -### Image-Level AUC +## Image-Level AUC | Model | | Avg | Carpet | Grid | Leather | Tile | Wood | Bottle | Cable | Capsule | Hazelnut | Metal Nut | Pill | Screw | Toothbrush | Transistor | Zipper | | ------------- | ------------------ | :-------: | :-------: | :-------: | :-----: | :-------: | :-------: | :-----: | :-------: | :-------: | :------: | :-------: | :-------: | :-------: | :--------: | :--------: | :-------: | @@ -279,7 +291,7 @@ Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License | STFPM | Wide ResNet-50 | 0.903 | 0.987 | **0.989** | 0.980 | 0.966 | 0.956 | 0.966 | 0.913 | 0.956 | 0.974 | 0.961 | 0.946 | 0.988 | 0.178 | 0.807 | 0.980 | | STFPM | ResNet-18 | 0.951 | 0.986 | 0.988 | 0.991 | 0.946 | 0.949 | 0.971 | 0.898 | 0.962 | 0.981 | 0.942 | 0.878 | 0.983 | 0.983 | 0.838 | 0.972 | -### Image F1 Score +## Image F1 Score | Model | | Avg | Carpet | Grid | Leather | Tile | Wood | Bottle | Cable | Capsule | Hazelnut | Metal Nut | Pill | Screw | Toothbrush | Transistor | Zipper | | ------------- | ------------------ | :-------: | :-------: | :-------: | :-------: | :-------: | :-------: | :-------: | :-------: | :-------: | :-------: | :-------: | :-------: | :-------: | :--------: | :--------: | :-------: | @@ -296,9 +308,11 @@ Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License | DFKDE | ResNet-18 | 0.872 | 0.864 | 0.844 | 0.854 | 0.960 | 0.898 | 0.942 | 0.793 | 0.908 | 0.827 | 0.894 | 0.916 | 0.859 | 0.853 | 0.756 | 0.916 | | GANomaly | | 0.834 | 0.864 | 0.844 | 0.852 | 0.836 | 0.863 | 0.863 | 0.760 | 0.905 | 0.777 | 0.894 | 0.916 | 0.853 | 0.833 | 0.571 | 0.881 | -## Reference +# Reference + If you use this library and love it, use this to cite it πŸ€— -``` + +```tex @misc{anomalib, title={Anomalib: A Deep Learning Library for Anomaly Detection}, author={Samet Akcay and diff --git a/anomalib/models/cflow/README.md b/anomalib/models/cflow/README.md index e8d3cfe139..3b97c2d7a2 100644 --- a/anomalib/models/cflow/README.md +++ b/anomalib/models/cflow/README.md @@ -1,4 +1,4 @@ -# Real-Time Unsupervised Anomaly Detection via Conditional Normalizing Flows +# Real-Time Unsupervised Anomaly Detection via Conditional Normalizing Flows This is the implementation of the [CFLOW-AD](https://arxiv.org/pdf/2107.12571v1.pdf) paper. This code is modified form of the [official repository](https://github.com/gudovskiy/cflow-ad). @@ -26,19 +26,19 @@ All results gathered with seed `42`. | | Avg | Carpet | Grid | Leather | Tile | Wood | Bottle | Cable | Capsule | Hazelnut | Metal Nut | Pill | Screw | Toothbrush | Transistor | Zipper | | -------------- | :---: | :----: | :---: | :-----: | :---: | :---: | :----: | :---: | :-----: | :------: | :-------: | :---: | :---: | :--------: | :--------: | :----: | -| Wide ResNet-50 | 0.962 | 0.986 | 0.962 | 1.0 | 0.999 | 0.993 | 1.0 | 0.893 | 0.945 | 1.0 | 0.995 | 0.924 | 0.908 | 0.897 | 0.943 | 0.984 | +| Wide ResNet-50 | 0.962 | 0.986 | 0.962 | 1.0 | 0.999 | 0.993 | 1.0 | 0.893 | 0.945 | 1.0 | 0.995 | 0.924 | 0.908 | 0.897 | 0.943 | 0.984 | ### Pixel-Level AUC | | Avg | Carpet | Grid | Leather | Tile | Wood | Bottle | Cable | Capsule | Hazelnut | Metal Nut | Pill | Screw | Toothbrush | Transistor | Zipper | | -------------- | :---: | :----: | :---: | :-----: | :---: | :---: | :----: | :---: | :-----: | :------: | :-------: | :---: | :---: | :--------: | :--------: | :----: | -| Wide ResNet-50 | 0.971 | 0.986 | 0.968 | 0.993 | 0.968 | 0.924 | 0.981 | 0.955 | 0.988 | 0.990 | 0.982 | 0.983 | 0.979 | 0.985 | 0.897 | 0.980 | +| Wide ResNet-50 | 0.971 | 0.986 | 0.968 | 0.993 | 0.968 | 0.924 | 0.981 | 0.955 | 0.988 | 0.990 | 0.982 | 0.983 | 0.979 | 0.985 | 0.897 | 0.980 | ### Image F1 Score | | Avg | Carpet | Grid | Leather | Tile | Wood | Bottle | Cable | Capsule | Hazelnut | Metal Nut | Pill | Screw | Toothbrush | Transistor | Zipper | | -------------- | :---: | :----: | :---: | :-----: | :---: | :---: | :----: | :---: | :-----: | :------: | :-------: | :---: | :---: | :--------: | :--------: | :----: | -| Wide ResNet-50 | 0.944 | 0.972 | 0.932 | 1.000 | 0.988 | 0.967 | 1.000 | 0.832 | 0.939 | 1.000 | 0.979 | 0.924 | 0.971 | 0.870 | 0.818 | 0.967 | +| Wide ResNet-50 | 0.944 | 0.972 | 0.932 | 1.000 | 0.988 | 0.967 | 1.000 | 0.832 | 0.939 | 1.000 | 0.979 | 0.924 | 0.971 | 0.870 | 0.818 | 0.967 | ### Sample Results diff --git a/anomalib/models/components/freia/README.md b/anomalib/models/components/freia/README.md index b9ef90a20b..9fa6281739 100644 --- a/anomalib/models/components/freia/README.md +++ b/anomalib/models/components/freia/README.md @@ -1,5 +1,7 @@ -## FrEIA +# FrEIA + This sub-package contains freia packages to use within flow-based algorithms such as Cflow. ## Description + [FrEIA](https://github.com/VLL-HD/FrEIA) package is currently not available in pypi to install via pip. The only way to install it is `pip install git+https://github.com/VLL-HD/FrEIA.git`. PyPI, however, does not support installing packages from git links. Due to this limitation, anomalib cannot be updated on PyPI. To avoid this, `anomalib` contains some of the [FrEIA](https://github.com/VLL-HD/FrEIA) modules to facilitate CFlow training/inference. diff --git a/anomalib/models/draem/README.md b/anomalib/models/draem/README.md index 8780574c98..d888f1860f 100644 --- a/anomalib/models/draem/README.md +++ b/anomalib/models/draem/README.md @@ -11,6 +11,7 @@ DRAEM is a reconstruction based algorithm that consists of a reconstructive subn For optimal results, DRAEM requires specifying the path to a folder of image data that will be used as the source of the anomalous pixel regions in the simulated anomaly images. The path can be specified by editing the value of the `model.anomaly_source_path` parameter in the `config.yaml` file. The authors of the original paper recommend using the [DTD](https://www.robots.ox.ac.uk/~vgg/data/dtd/) dataset as anomaly source. ## Architecture + ![DRAEM Architecture](../../../docs/source/images/draem/architecture.png "DRAEM Architecture") ## Usage diff --git a/anomalib/models/fastflow/README.md b/anomalib/models/fastflow/README.md index c79bc53249..057269f359 100644 --- a/anomalib/models/fastflow/README.md +++ b/anomalib/models/fastflow/README.md @@ -1,6 +1,6 @@ # FastFlow: Unsupervised Anomaly Detection and Localization via 2D Normalizing Flows -This is the implementation of the [FastFlow](https://arxiv.org/abs/2111.07677) paper. This code is developed by utilizing the torch model implemented in [https://github.com/gathierry/FastFlow](https://github.com/gathierry/FastFlow). +This is the implementation of the [FastFlow](https://arxiv.org/abs/2111.07677) paper. This code is developed by utilizing the torch model implemented in [https://github.com/gathierry/FastFlow](https://github.com/gathierry/FastFlow). Model Type: Segmentation @@ -23,6 +23,7 @@ All results gathered with seed `0`. ## [MVTec AD Dataset](https://www.mvtec.com/company/research/datasets/mvtec-ad) --- + **NOTE** When the numbers are produced, early stopping callback (patience: 3) is used. It might be possible to achieve higher-metrics by increasing the patience. @@ -50,7 +51,6 @@ When the numbers are produced, early stopping callback (patience: 3) is used. It | Zipper | 0.878 | 0.951 | 0.981 | 0.977 | | Average | | | | | - ### Pixel-Level AUC | | ResNet-18 | Wide ResNet50 | DeiT | CaiT | @@ -72,9 +72,8 @@ When the numbers are produced, early stopping callback (patience: 3) is used. It | Zipper | 0.965 | 0.985 | 0.978 | 0.979 | | Average | | | | | - - ### Image F1 Score + | | ResNet-18 | Wide ResNet50 | DeiT | CaiT | | ---------- | :-------: | :-----------: | :---: | :---: | | Bottle | 0.976 | 0.952 | 0.741 | 0.977 | @@ -95,6 +94,7 @@ When the numbers are produced, early stopping callback (patience: 3) is used. It | Average | | | | | ### Pixel F1 Score + | | ResNet-18 | Wide ResNet50 | DeiT | CaiT | | ---------- | :-------: | :-----------: | :---: | :---: | | Bottle | 0.670 | 0.733 | 0.753 | 0.725 | @@ -114,7 +114,6 @@ When the numbers are produced, early stopping callback (patience: 3) is used. It | Zipper | 0.492 | 0.621 | 0.522 | 0.504 | | Average | | | | | - ### Sample Results ![Sample Result 1](../../../docs/source/images/fastflow/results/0.png "Sample Result 1") diff --git a/anomalib/models/ganomaly/README.md b/anomalib/models/ganomaly/README.md index 563fc502eb..215674c81f 100644 --- a/anomalib/models/ganomaly/README.md +++ b/anomalib/models/ganomaly/README.md @@ -26,12 +26,12 @@ All results gathered with seed `42`. ### Image-Level AUC -| | Avg | Carpet | Grid | Leather | Tile | Wood | Bottle | Cable | Capsule | Hazelnut | Metal Nut | Pill | Screw | Toothbrush | Transistor | Zipper | -| -------------- | :---: | :----: | :---: | :-----: | :---: | :---: | :----: | :---: | :-----: | :------: | :-------: | :---: | :---: | :--------: | :--------: | :----: | -| | 0.421 | 0.203 | 0.404 | 0.413 | 0.408 | 0.744 | 0.251 | 0.457 | 0.682 | 0.537 | 0.270 | 0.472 | 0.231 | 0.372 | 0.440 | 0.434 | +| | Avg | Carpet | Grid | Leather | Tile | Wood | Bottle | Cable | Capsule | Hazelnut | Metal Nut | Pill | Screw | Toothbrush | Transistor | Zipper | +| --- | :---: | :----: | :---: | :-----: | :---: | :---: | :----: | :---: | :-----: | :------: | :-------: | :---: | :---: | :--------: | :--------: | :----: | +| | 0.421 | 0.203 | 0.404 | 0.413 | 0.408 | 0.744 | 0.251 | 0.457 | 0.682 | 0.537 | 0.270 | 0.472 | 0.231 | 0.372 | 0.440 | 0.434 | ### Image F1 Score -| | Avg | Carpet | Grid | Leather | Tile | Wood | Bottle | Cable | Capsule | Hazelnut | Metal Nut | Pill | Screw | Toothbrush | Transistor | Zipper | -| -------------- | :---: | :----: | :---: | :-----: | :---: | :---: | :----: | :---: | :-----: | :------: | :-------: | :---: | :---: | :--------: | :--------: | :----: | -| | 0.834 | 0.864 | 0.844 | 0.852 | 0.836 | 0.863 | 0.863 | 0.760 | 0.905 | 0.777 | 0.894 | 0.916 | 0.853 | 0.833 | 0.571 | 0.881 | +| | Avg | Carpet | Grid | Leather | Tile | Wood | Bottle | Cable | Capsule | Hazelnut | Metal Nut | Pill | Screw | Toothbrush | Transistor | Zipper | +| --- | :---: | :----: | :---: | :-----: | :---: | :---: | :----: | :---: | :-----: | :------: | :-------: | :---: | :---: | :--------: | :--------: | :----: | +| | 0.834 | 0.864 | 0.844 | 0.852 | 0.836 | 0.863 | 0.863 | 0.760 | 0.905 | 0.777 | 0.894 | 0.916 | 0.853 | 0.833 | 0.571 | 0.881 | diff --git a/docs/blog/001-train-custom-dataset/README.md b/docs/blog/001-train-custom-dataset/README.md index 8d8bf76de0..9559f205de 100644 --- a/docs/blog/001-train-custom-dataset/README.md +++ b/docs/blog/001-train-custom-dataset/README.md @@ -1,24 +1,27 @@ # How to Train Your Custom Dataset with Anomalib +
## Introducing Anomalib -A Deep Learning Library called Anomalib was released by a group of Intel AI researchers in early 2022. The library includes cutting-edge algorithms for detecting anomalies in image datasets. Anomalib is a comprehensive end-to-end solution that includes many features for achieving the highest accuracy model as well as inference deployment code with Intel's OpenVino Toolkit. +A Deep Learning Library called Anomalib was released by a group of Intel AI researchers in early 2022. The library includes cutting-edge algorithms for detecting anomalies in image datasets. Anomalib is a comprehensive end-to-end solution that includes many features for achieving the highest accuracy model as well as inference deployment code with Intel's OpenVino Toolkit. -## Why a dedicated library for Anomaly Detection? +## Why a dedicated library for Anomaly Detection Anomaly detection is the process of identifying anomalous items in a stream of input data. An example of a real-world anomaly detection problem is industrial defect detection, where the aim is to identify anomalous products in the output of a production line. In this type of application, anomalous items occur much less frequently than normal items, which makes it challenging to collect sufficient representative samples of the anomalous class. On top of that, the anomalous class is not well defined, and can contain a wide range of different defect types. These characteristics make it difficult to solve anomaly detection problems with classical, supervised methods. Instead, anomaly detection algorithms usually rely on unsupervised techniques to learn an implicit representation of normality, the normality model. During inference, new samples are compared against this normality model to determine if they belong to the normal or anomalous category. -Anomalib aims to collect the most recent deep-learning based anomaly detection algorithms with the purpose of providing a tool that makes it easy to benchmark different anomaly detection algorithms on public and custom datasets. Anomalib is continuously updated with the latest State-of-the-Art algorithms, and contains several tools and interfaces that can be used to run experiments and create and test new algorithms. +Anomalib aims to collect the most recent deep-learning based anomaly detection algorithms with the purpose of providing a tool that makes it easy to benchmark different anomaly detection algorithms on public and custom datasets. Anomalib is continuously updated with the latest State-of-the-Art algorithms, and contains several tools and interfaces that can be used to run experiments and create and test new algorithms. ## How to train a Custom dataset with Anomalib Anomalib supports a number of datasets in various formats, including the state-of-the-art anomaly detection benchmarks such as MVTec AD and BeanTech. For those who would like to use the library on their custom datasets, anomalib also provides a `Folder` datamodule that can load datasets from a folder on a file system. The scope of this post will be to train anomalib models on custom datasets using the `Folder` datamodule. ### Step 1: Install Anomalib + #### Option - 1 : PyPI + Anomalib can be installed from PyPI via the following: ```bash @@ -26,7 +29,9 @@ pip install anomalib ``` #### Option - 2: Editable Install + Alternatively, it is also possible to do editable install: + ```bash git clone https://github.com/openvinotoolkit/anomalib.git cd anomalib @@ -34,24 +39,29 @@ pip install -e . ``` ### Step 2: Collect Your Custom Dataset + Anomalib supports multiple image extensions such as `".jpg", ".jpeg", ".png", ".ppm", ".bmp", ".pgm", ".tif", ".tiff", and ".webp"`. A dataset can be collected from images that have any of these extensions. ### Step 3: Format your dataset + Depending on the use-case and collection, custom datasets can have different formats, some of which are listed below: -- A dataset with good and bad images. -- A dataset with good and bad images as well as mask ground-truths for pixel-wise evaluation. -- A dataset with good and bad images that is already split into training and testing sets. -Each of these use-cases is addressed by anomalib's `Folder` datamodule. Let's focus on the first use-case as an example of end-to-end model training and inference. In this post, we will use a toy dataset which you can download from [here](https://openvinotoolkit.github.io/anomalib/_downloads/3f2af1d7748194b18c2177a34c03a2c4/hazelnut_toy.zip). The dataset consists of several folders, each containing a set of images. The _colour_ and the _crack_ folders represent two kinds of defects. We can ignore the _masks_ folder for now. +- A dataset with good and bad images. +- A dataset with good and bad images as well as mask ground-truths for pixel-wise evaluation. +- A dataset with good and bad images that is already split into training and testing sets. + +Each of these use-cases is addressed by anomalib's `Folder` datamodule. Let's focus on the first use-case as an example of end-to-end model training and inference. In this post, we will use a toy dataset which you can download from [here](https://openvinotoolkit.github.io/anomalib/_downloads/3f2af1d7748194b18c2177a34c03a2c4/hazelnut_toy.zip). The dataset consists of several folders, each containing a set of images. The _colour_ and the _crack_ folders represent two kinds of defects. We can ignore the _masks_ folder for now. Load your data to the following directory structure. Anomalib will use all images in the _colour_ folder as part of the validation dataset and then randomly split the good images for training and validation. -``` + +```bash Hazelnut_toy β”œβ”€β”€ colour └── good ``` ### Step 4: Modify Config File + A YAML configuration file is necessary to run training for Anomalib. The training configuration parameters are categorized into 5 sections: `dataset`, `model`, `project`, `logging`, `trainer`. To get Anomalib functionally working with a custom dataset, one only needs to change the `dataset` section of the configuration file. @@ -103,19 +113,22 @@ model: ``` ### Step 5: Run training + As per the config file, move `Hazelnut_toy` to the datasets section in the main root directory of anomalib, and then run ```bash python tools/train.py --config custom_padim.yaml ``` -### Step 6: Interpret Results +### Step 6: Interpret Results + Anomalib will print out results of the trained model on the validation dataset. The printed metrics are dependent on the task mode chosen. The classification example provided in this tutorial prints out two scores: F1 and AUROC. The F1 score is a metric which values both the precision and recall, more information on its calculation can be found in this [blog](https://towardsdatascience.com/understanding-accuracy-recall-precision-f1-scores-and-confusion-matrices-561e0f5e328c). **Additional Info** Not only does Anomalib classify whether a part is defected or not, it can also be used to segment the defects as well. To do this, simply add a folder called _mask_ at the same directory level as the _good_ and _colour_ folders. This folder should contain binary images for the defects in the _colour_ folder. Here, the white pixels represent the location of the defect. Populate the mask field in the config file with `mask` and change the task to segmentation to see Anomalib segment defects. -``` + +```bash Hazelnut_toy β”œβ”€β”€ colour β”‚ β”œβ”€β”€ 00.jpg @@ -137,12 +150,14 @@ Here is an example of the generated results for a toy dataset containing Hazelnu ## Logging and Experiment Management + While it is delightful to know how good your model performed on your preferred metric, it is even more exciting to see the predicted outputs. Anomalib provides a couple of ways to log and track experiments. These can be used individually or in a combination. As of the current release, you can save images to a local folder, or upload to weights and biases, or TensorBoard. To select where you would like to save the images, change the `log_images_to` parameter in the `project` section in the config file. For example, setting the following `log_images_to: ["local"]` will result in saving the images in the results folder as shown in the tree structure below: -``` + +```bash results └── padim └── Hazelnut_toy @@ -160,13 +175,15 @@ results ``` ### Logging to Tensorboard and/or W&B -To use TensorBoard and/or W&B logger, ensure that the logger parameter is set to `tensorboard`, `wandb` or `[tensorboard, wandb]` in the `logging` section of the config file. -An example configuration for saving to TensorBoard is shown in the figure below. Similarly after setting logger to `wandb` you will see the images on your wandb project dashboard. +To use TensorBoard and/or W&B logger, ensure that the logger parameter is set to `tensorboard`, `wandb` or `[tensorboard, wandb]` in the `logging` section of the config file. + +An example configuration for saving to TensorBoard is shown in the figure below. Similarly after setting logger to `wandb` you will see the images on your wandb project dashboard. + ```yaml logging: - log_images_to: [tensorboard] - logger: tensorboard # options: [tensorboard, wandb, csv] or combinations. + log_images_to: [tensorboard] + logger: tensorboard # options: [tensorboard, wandb, csv] or combinations. ```
@@ -174,6 +191,7 @@ logging:
### Hyper-Parameter Optimization + It is very rare to find a model which works out of the box for a particular dataset. However, fortunately, we support tools which work out of the box to help tune the models in Anomalib to your particular dataset. As of the publication of this blog post, Anomalib supports [weights and biases](https://wandb.ai/) for hyperparameter optimization. To get started have a look at `sweep.yaml` located at `tools/hpo`. It provides a sample of how one can define a hyperparameter sweep. ```yaml @@ -196,18 +214,20 @@ The observation_budget informs wandb about the number of experiments to run. The To run a sweep, you can just call, -``` +```bash python tools/hpo/wandb_sweep.py --model padim --config ./path_to_config.yaml --sweep_config tools/hpo/sweep.yaml" ``` In case `model_config` is not provided, the script looks at the default config location for that model. Note, you will need to have logged into a wandb account to use HPO search and view the results. A sample run is visible in the screenshot below. +
## Benchmarking + To add to the suit of experiment tracking and optimization, anomalib also includes a benchmarking script for gathering results across different combinations of models, their parameters, and dataset categories. The model performance and throughputs are logged into a csv file that can also serve as a means to track model drift. Optionally, these same results can be logged to Weights and Biases and TensorBoard. A sample configuration file is shown in the screenshot below. ```yaml diff --git a/docs/source/guides/structure_of_documentation.md b/docs/source/guides/structure_of_documentation.md index 36d5a87acf..502eeaa425 100644 --- a/docs/source/guides/structure_of_documentation.md +++ b/docs/source/guides/structure_of_documentation.md @@ -1,13 +1,13 @@ # Structure of the Documentation - This documentation is divided into the following sections: + 1. Getting Started -2. Models -3. API Reference -4. Tutorials -5. Guides -6. Research +1. Models +1. API Reference +1. Tutorials +1. Guides +1. Research ## Getting Started @@ -23,6 +23,7 @@ responsibility to update this page when a new model is added to the repo. This page lists all the modules, classes and functions available within the `anomalib` package. This page is update automatically for the following modules: + - config - core - datasets diff --git a/docs/source/guides/using_pre_commit.md b/docs/source/guides/using_pre_commit.md index 63c1bfd9ab..0d1a58ba26 100644 --- a/docs/source/guides/using_pre_commit.md +++ b/docs/source/guides/using_pre_commit.md @@ -1,23 +1,24 @@ (pre-commit_hooks)= + # Pre-commit Hooks First of all, you will need to install development requirements. This will also install the pre-commit pip package in your python environment -```pip install -r requirements/dev.txt``` +`pip install -r requirements/dev.txt` Then, install pre-commit hooks using the following command: -```pre-commit install``` +`pre-commit install` Pre-commit hooks will run several formatters, linters and type checkers each time you commit some changes to a branch. Some tools like black and isort will automatically format your files to enforce consistent formatting within the repo. Other tools will provide a list of errors and warnings which you will be required to address before being able to make the commit. In some cases it might be desired to commit your changes even though some of the checks are failing. For example when you want to address the pre-commit issues at a later time, or when you want to commit a work-in-progress. In these cases, you can skip the pre-commit hooks by adding the `--no-verify` parameter to the commit command. -```git commit -m 'WIP commit' --no-verify``` +`git commit -m 'WIP commit' --no-verify` When doing so, please make sure to revisit the issues at a later time. A good way to check if all issues have been addressed before making an MR is to run tox. Apart from tox, you can also run `pre-commit` on all the files to check formatting and style issues. To do this you can use -```pre-commit run --all``` +`pre-commit run --all` diff --git a/docs/source/guides/using_tox.md b/docs/source/guides/using_tox.md index 44e2dbb410..788a78bacf 100644 --- a/docs/source/guides/using_tox.md +++ b/docs/source/guides/using_tox.md @@ -1,12 +1,15 @@ (using_tox)= + # Using Tox The quality of code for `anomalib` maintained by using tools such as `black`, `mypy`, and `flake8`. In order to enforce these, we use Tox. This is also the reason why we don't have dependencies such as `pytest` in the `requirements.txt` file. What is tox? -> `tox` aims to automate and standardize testing in Python. It is part of a larger vision of easing the packaging, testing and release process of Python software. +> `tox` aims to automate and standardize testing in Python. It is part of a larger vision of easing the packaging, testing and release process of Python software. +> > It is a generic virtualenv management and test command line tool you can use for: +> > - checking that your package installs correctly with different Python versions and interpreters > - running your tests in each of the environments, configuring your test tool of choice > - acting as a frontend to Continuous Integration servers, greatly reducing boilerplate and merging CI and shell-based testing. - from the [docs](https://tox.readthedocs.io/) @@ -18,20 +21,29 @@ See [getting started](#setting-up-and-getting-started) to dive in and get `tox` Setting up tox is easy 1. Create new Conda environment + `conda create -n toxenv python=3.8` -2. Activate the environment +1. Activate the environment + `conda activate toxenv` -3. Install tox +1. Install tox + `pip install tox` -4. Run +1. Run + `tox` It should setup the environments and install the dependencies. -```{note} All developers are required to run tox before creating their MR. If you have setup pre-commit hooks then this step can be skipped. -``` +--- + +**NOTE** + +All developers are required to run tox before creating their MR. If you have setup pre-commit hooks then this step can be skipped. + +--- ## Brief Explanation of `tox.ini` @@ -46,7 +58,7 @@ All `tox` files start with `envlist` This defines all the environments that tox should create. Take for example that we want to create an environment to run `black` formatter. We can name this environment as: -``` +```ini [tox] envlist = black_env @@ -54,7 +66,7 @@ envlist = Then to define the commands in this environment all we need to do is start a block with `[testenv:black_env]` and then define the dependencies and call the commands. -``` +```ini [testenv:black_env] deps = black commands = black . diff --git a/docs/source/research/benchmark.md b/docs/source/research/benchmark.md index ad31647816..354f0d30ba 100644 --- a/docs/source/research/benchmark.md +++ b/docs/source/research/benchmark.md @@ -27,6 +27,7 @@ | PatchCore | Wide ResNet-50 | 0.955 | 0.988 | 0.903 | 0.990 | 0.957 | 0.936 | 0.972 | 0.950 | 0.968 | 0.974 | 0.960 | 0.948 | 0.917 | 0.969 | 0.913 | 0.976 | | PaDiM | ResNet-18 | 0.968 | 0.984 | 0.918 | **0.994** | 0.934 | 0.947 | 0.983 | 0.965 | 0.984 | 0.978 | 0.970 | 0.957 | 0.978 | 0.988 | 0.968 | 0.979 | | **PaDiM** | **Wide ResNet-50** | **0.979** | **0.991** | 0.970 | 0.993 | 0.955 | **0.957** | **0.985** | **0.970** | **0.988** | **0.985** | **0.982** | **0.966** | **0.988** | **0.991** | **0.976** | **0.986** | + ### Image F1 Score | Model | | Avg | Carpet | Grid | Leather | Tile | Wood | Bottle | Cable | Capsule | Hazelnut | Metal Nut | Pill | Screw | Toothbrush | Transistor | Zipper | diff --git a/docs/source/research/citation.md b/docs/source/research/citation.md index 2485b53bdc..5aced2cab5 100644 --- a/docs/source/research/citation.md +++ b/docs/source/research/citation.md @@ -2,7 +2,7 @@ You can cite this repository as -``` +```tex @misc{anomalib, title={Anomalib: A Deep Learning Library for Anomaly Detection}, author={Samet Akcay and diff --git a/markdownlint.rb b/markdownlint.rb new file mode 100644 index 0000000000..4515a6a379 --- /dev/null +++ b/markdownlint.rb @@ -0,0 +1,62 @@ +################################################################################ +# Modified using +# https://github.com/jumanjihouse/pre-commit-hooks/blob/master/ci/jumanjistyle.rb +################################################################################ + + +# frozen_string_literal: true + +################################################################################ +# Style file for markdownlint. +# +# https://github.com/markdownlint/markdownlint/blob/master/docs/configuration.md +# +# This file is referenced by the project `.mdlrc`. +################################################################################ + +#=============================================================================== +# Start with all built-in rules. +# https://github.com/markdownlint/markdownlint/blob/master/docs/RULES.md +all + +#=============================================================================== +# Override default parameters for some built-in rules. +# https://github.com/markdownlint/markdownlint/blob/master/docs/creating_styles.md#parameters + +# Allow both fenced and indented code blocks. +# rule 'MD046', style: ['fenced', 'indented'] + +# Ignore line length in code blocks. +rule 'MD013', :line_length => 1000 +# rule 'MD013', code_blocks: false + +#=============================================================================== +# Exclude the rules I disagree with. + +# IMHO it's easier to read lists like: +# * outmost indent +# - one indent +# - second indent +# * Another major bullet +exclude_rule 'MD004' # Unordered list style + +# I prefer two blank lines before each heading. +exclude_rule 'MD012' # Multiple consecutive blank lines + +# This is not useful for some files such as `CHANGELOG.md` +exclude_rule 'MD024' # Multiple headers with the same content + +# I find it necessary to use '
' to force line breaks. +exclude_rule 'MD033' # Inline HTML + +# If a page is printed, it helps if the URL is viewable. +exclude_rule 'MD034' # Bare URL used + +# Some md files have comments or links at the top of the files. +exclude_rule 'MD041' # First line in file should be a top level header + +#=============================================================================== +# Exclude rules for pragmatic reasons. + +# Either disable this one or MD024 - Multiple headers with the same content. +exclude_rule 'MD036' # Emphasis used instead of a header diff --git a/notebooks/100_datamodules/README.md b/notebooks/100_datamodules/README.md index 5423c8488a..e9cf385435 100644 --- a/notebooks/100_datamodules/README.md +++ b/notebooks/100_datamodules/README.md @@ -1,13 +1,14 @@ # Anomalib DataModules + The notebooks in this section demonstrate the mechanics of anomalib data modules, with a specific focus on benchmarks such as MVTec AD, BTech, and custom datasets via the Folder module. Anomalib data modules are structured as follows: Each data collection implements the Torch Dataset and the PyTorch Lightning DataModule objects. The Torch Dataset inherits `torch.utils.data.Dataset` and implement the `__len__` and `__getitem__` methods. This implementation might therefore be utilized not just for anomalib, but also for other implementations. -The DataModule implementation inherits the PyTorch Lightning `DataModule` object. The advantage of this class is that it organizes each step of data from download to creating the Torch dataloader.Β  +The DataModule implementation inherits the PyTorch Lightning `DataModule` object. The advantage of this class is that it organizes each step of data from download to creating the Torch dataloader. Overall, a data implementation has the following structure: -``` +```bash anomalib β”œβ”€β”€ __init__.py β”œβ”€β”€ data diff --git a/notebooks/README.md b/notebooks/README.md index 7163c35f5f..2625ab725d 100644 --- a/notebooks/README.md +++ b/notebooks/README.md @@ -15,10 +15,10 @@ | Folder | [103_folder](100_datamodules/103_folder.ipynb) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/openvinotoolkit/anomalib/blob/development/notebooks/100_datamodules/103_folder.ipynb) | ## 2. Models -| Notebook | GitHub | Colab | -| ------------ | ----------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| Model | [201_fastflow](200_models/201_fastflow.ipynb) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/openvinotoolkit/anomalib/blob/development/notebooks/200_models/201_fastflow.ipynb) | +| Notebook | GitHub | Colab | +| -------- | --------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Model | [201_fastflow](200_models/201_fastflow.ipynb) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/openvinotoolkit/anomalib/blob/development/notebooks/200_models/201_fastflow.ipynb) | ## 3. Benchmarking and Hyperparameter Optimization diff --git a/tools/benchmarking/README.md b/tools/benchmarking/README.md index d54e254253..8b93aba717 100644 --- a/tools/benchmarking/README.md +++ b/tools/benchmarking/README.md @@ -5,31 +5,10 @@ These bash scripts will assist in measuring the training performance of the anom The python script (`benchmark.py`) will assist in computing metrics for all the models in the repository. ## Usage -Run the train.sh with the same args as the tools/train.py. Refer to [`../README.md`](https://github.com/openvinotoolkit/anomalib/blob/development/README.md) for those details. - -Note: To collect memory read/write numbers, run the script with sudo privileges. Otherwise, those values will be blank. - -``` -sudo -E ./train.sh # Train STFPM on MVTec AD leather - -sudo -E ./train.sh --config - -sudo -E ./train.sh --model stfpm -``` - -The training script will create an output directory in this location, and inside it will have a time stamped directory for each training run you do. You can find the raw logs in there, as well as any errors captured in the train.log file. - -For post processing, run the post-process.sh script with the results directory you want to post process. - -``` -./post-process.sh ./output/2021Aug31_2351 -``` - ---- To use the python script, run it from the root directory. -``` +```bash python tools/benchmarking/benchmark.py ```