Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

πŸš€ V1 #1663

Merged
merged 91 commits into from
Jan 24, 2024
Merged

πŸš€ V1 #1663

merged 91 commits into from
Jan 24, 2024

Conversation

ashwinvaidya17
Copy link
Collaborator

πŸ“ Description

Provide a clear summary of the changes and the issue that has been addressed.

πŸ› οΈ Fixes # (issue number)

✨ Changes

Select what type of change your PR is:

  • 🐞 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)
  • πŸ“š Documentation update

βœ… Checklist

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

  • πŸ“‹ I have summarized my changes in the CHANGELOG and followed the guidelines for my type of change (skip for minor changes, documentation updates, and test enhancements).
  • πŸ“š I have made the necessary updates to the documentation (if applicable).
  • πŸ§ͺ I have written tests that support my changes and prove that my fix is effective or my feature works (if applicable).

ashwinvaidya17 and others added 30 commits August 24, 2023 15:15
)

Upgrade to Lightning 2.0.5 (#1221)

* Adapt code and configs to PL 2.0.5

* Pre-commit checks.

* Fix a function call.

* Fix function calls.

* pytorch_lightning -> lightning.pytorch

* Add lightning to requirements

---------

Co-authored-by: Weilin Xu <mzweilin@gmail.com>
Co-authored-by: Samet <samet.akcay@intel.com>
* Upgrade to Lightning 2.0.5 (#1221)

* Adapt code and configs to PL 2.0.5

* Pre-commit checks.

* Fix a function call.

* Fix function calls.

* pytorch_lightning -> lightning.pytorch

* Add lightning to requirements

---------

Co-authored-by: Samet <samet.akcay@intel.com>

* partially restore tests

* Address PR comments

---------

Co-authored-by: Weilin Xu <mzweilin@gmail.com>
Co-authored-by: Samet <samet.akcay@intel.com>
Co-authored-by: Ashwin Vaidya <ashwinitinvaidya@gmail.com>
* remove __future__

* Update changelog

---------

Co-authored-by: Ashwin Vaidya <ashwinitinvaidya@gmail.com>
* remove __future__

* Update changelog

* 🚚 Trainer -> AnomalibTrainer

* add post-processor

* Refactor callback

* Remove handler

* Address PR comments

---------

Co-authored-by: Ashwin Vaidya <ashwinitinvaidya@gmail.com>
* remove __future__

* Update changelog

* 🚚 Trainer -> AnomalibTrainer

* add post-processor

* Refactor callback

* Refactor normalization callback

* Match convention

* Refactor imports

* Address PR comments

* Fix path

* Refactor callbacks

* Fix module path

---------
* remove __future__

* Update changelog

* 🚚 Trainer -> AnomalibTrainer

* add post-processor

* Refactor callback

* Refactor normalization callback

* Refactor thresholding

* Match convention

* Refactor imports

* Address PR comments

* Fix path

* Refactor callbacks

* Fix module path

* Address PR comments

* Apply suggestions from code review

Co-authored-by: Samet Akcay <samet.akcay@intel.com>

---------

Co-authored-by: Samet Akcay <samet.akcay@intel.com>
* remove __future__

* Update changelog

* 🚚 Trainer -> AnomalibTrainer

* add post-processor

* Refactor callback

* Refactor normalization callback

* Refactor thresholding

* Refactor metrics configuration

* Match convention

* Refactor imports

* Address PR comments

* Fix path

* Refactor callbacks

* Fix module path

* Address PR comments

* Address PR comments

---------

Co-authored-by: Ashwin Vaidya <ashwinitinvaidya@gmail.com>
* remove __future__

* Update changelog

* 🚚 Trainer -> AnomalibTrainer

* add post-processor

* Refactor callback

* Refactor normalization callback

* Refactor thresholding

* Refactor metrics configuration

* Move visualizer callbacks into trainer

* Match convention

* Refactor imports

* Address PR comments

* Fix path

* Refactor callbacks

* Fix module path

* Address PR comments

* Remove comment

---------

Co-authored-by: Ashwin Vaidya <ashwinitinvaidya@gmail.com>
* Initial engine design

* Address PR comments

* Circular import + trainer->engine

* Update src/anomalib/engine/engine.py

* revert import in __init__

---------

Co-authored-by: Ashwin Vaidya <ashwinitinvaidya@gmail.com>
Co-authored-by: Samet Akcay <samet.akcay@intel.com>
* Partially fix test

* Address PR comments

---------

Co-authored-by: Ashwin Vaidya <ashwinitinvaidya@gmail.com>
* Support trainer methods

* support yaml serialization

* add hpo command

* Add benchmark + train entrypoint

* Add export arguments

* Partially address PR comments

* Add export subcommands + refactor

* Address PR comments

---------

Co-authored-by: Ashwin Vaidya <ashwinitinvaidya@gmail.com>
* Fix tests

* Patch get experiment logger

* Sort imports

* Add stfpm config

---------

Co-authored-by: Ashwin Vaidya <ashwinitinvaidya@gmail.com>
* Add rules to pyproject.toml file

* Only include padim and stfpm in tests

* Fix notebook tests

* Fix notebook tests
* pyflakes

* pycodestyle

* pep8-naming (`N`)
* pyflakes

* pycodestyle

* pep8-naming (`N`)

* pyupgrade (`UP`)

* flake8-bandit (`S`)

* Enabled UP, ANN, S, BLE, FBT, B

* Fix typo

* Revert F1AdaptiveThreshold parent classes

* Fix some of the tests

* ignore boolean-positional-value-in-call (FBT003)

* Addressed pr comments

* Remove duplicated lines
* pyflakes

* pycodestyle

* pep8-naming (`N`)

* pyupgrade (`UP`)

* flake8-bandit (`S`)

* Enabled UP, ANN, S, BLE, FBT, B

* Fix typo

* Revert F1AdaptiveThreshold parent classes

* Fix some of the tests

* ignore boolean-positional-value-in-call (FBT003)

* Addressed pr comments

* Remove duplicated lines

* flake8-builtins (`A`) and flake8-commas (`COM`)

* flake8-comprehensions (`C4`)

* flake8-datatimez (`DTZ`), flake8-debugger (`T10`), flake8-errmsg (`EM`)
* implement manual optimizers for ganomaly

* cleanup
* pyflakes

* pycodestyle

* pep8-naming (`N`)

* pyupgrade (`UP`)

* flake8-bandit (`S`)

* Enabled UP, ANN, S, BLE, FBT, B

* Fix typo

* Revert F1AdaptiveThreshold parent classes

* Fix some of the tests

* ignore boolean-positional-value-in-call (FBT003)

* Addressed pr comments

* Remove duplicated lines

* flake8-builtins (`A`) and flake8-commas (`COM`)

* flake8-comprehensions (`C4`)

* flake8-datatimez (`DTZ`), flake8-debugger (`T10`), flake8-errmsg (`EM`)

* flake8-pie (`PIE`)

* flake8-raise (`RSE`)

* flake8-return (`RET`)

* flake8-self (`SLF`)

* flake8-simplify (`SIM`)

* flake8-unsused-arguments (`ARG`)

* Update src/anomalib/models/components/flow/all_in_one_block.py

Co-authored-by: Ashwin Vaidya <ashwinnitinvaidya@gmail.com>

* addressed pr comments

---------

Co-authored-by: Ashwin Vaidya <ashwinnitinvaidya@gmail.com>
* Add checks

* Add checks for wandb

* move exception handling to method

* fix pre-commit issue

---------

Co-authored-by: Ashwin Vaidya <ashwinitinvaidya@gmail.com>
Remove max epochs>1 from default param list

Co-authored-by: Ashwin Vaidya <ashwinitinvaidya@gmail.com>
* Add checks

* Add default values to datasets + padim model

* update default values

* Remove merge artifact

* Change gt path

---------

Co-authored-by: Ashwin Vaidya <ashwinitinvaidya@gmail.com>
* pyflakes

* pycodestyle

* pep8-naming (`N`)

* pyupgrade (`UP`)

* flake8-bandit (`S`)

* Enabled UP, ANN, S, BLE, FBT, B

* Fix typo

* Revert F1AdaptiveThreshold parent classes

* Fix some of the tests

* ignore boolean-positional-value-in-call (FBT003)

* Addressed pr comments

* Remove duplicated lines

* flake8-builtins (`A`) and flake8-commas (`COM`)

* flake8-comprehensions (`C4`)

* flake8-datatimez (`DTZ`), flake8-debugger (`T10`), flake8-errmsg (`EM`)

* flake8-pie (`PIE`)

* flake8-raise (`RSE`)

* flake8-return (`RET`)

* flake8-self (`SLF`)

* flake8-simplify (`SIM`)

* flake8-unsused-arguments (`ARG`)

* flake8-use-pathlib (`PTH`)

* eradicate (`ERA`)

* pylint (`PL`)

* tryceratos (`TRY`), flynt (`FLY`), Perflint (`PERF`)

* NumPy-specific rules (`NPY`)

* Ruff-specific rules (`RUF`)

* Remove pylint ignore comments

* Fix tests

* Fix tests
* pyflakes

* pycodestyle

* pep8-naming (`N`)

* pyupgrade (`UP`)

* flake8-bandit (`S`)

* Enabled UP, ANN, S, BLE, FBT, B

* Fix typo

* Revert F1AdaptiveThreshold parent classes

* Fix some of the tests

* ignore boolean-positional-value-in-call (FBT003)

* Addressed pr comments

* Remove duplicated lines

* flake8-builtins (`A`) and flake8-commas (`COM`)

* flake8-comprehensions (`C4`)

* flake8-datatimez (`DTZ`), flake8-debugger (`T10`), flake8-errmsg (`EM`)

* flake8-pie (`PIE`)

* flake8-raise (`RSE`)

* flake8-return (`RET`)

* flake8-self (`SLF`)

* flake8-simplify (`SIM`)

* flake8-unsused-arguments (`ARG`)

* flake8-use-pathlib (`PTH`)

* eradicate (`ERA`)

* pylint (`PL`)

* tryceratos (`TRY`), flynt (`FLY`), Perflint (`PERF`)

* NumPy-specific rules (`NPY`)

* Ruff-specific rules (`RUF`)

* Remove pylint ignore comments

* Fix tests

* Fix tests

* mccabe (`C90`)

* pygrep-hooks (`PGH`)

* flake8-todos (`TD`)

* flake8-fixme (`FIX`)

* pandas-vet (`PD`)

* Fix random_split tests

* Fix pre-commit

* Fixed the logger test

* Fix the typos in todos
* pyflakes

* pycodestyle

* pep8-naming (`N`)

* pyupgrade (`UP`)

* flake8-bandit (`S`)

* Enabled UP, ANN, S, BLE, FBT, B

* Fix typo

* Revert F1AdaptiveThreshold parent classes

* Fix some of the tests

* ignore boolean-positional-value-in-call (FBT003)

* Addressed pr comments

* Remove duplicated lines

* flake8-builtins (`A`) and flake8-commas (`COM`)

* flake8-comprehensions (`C4`)

* flake8-datatimez (`DTZ`), flake8-debugger (`T10`), flake8-errmsg (`EM`)

* flake8-pie (`PIE`)

* flake8-raise (`RSE`)

* flake8-return (`RET`)

* flake8-self (`SLF`)

* flake8-simplify (`SIM`)

* flake8-unsused-arguments (`ARG`)

* flake8-use-pathlib (`PTH`)

* eradicate (`ERA`)

* pylint (`PL`)

* tryceratos (`TRY`), flynt (`FLY`), Perflint (`PERF`)

* NumPy-specific rules (`NPY`)

* Ruff-specific rules (`RUF`)

* Remove pylint ignore comments

* Fix tests

* Fix tests

* mccabe (`C90`)

* pygrep-hooks (`PGH`)

* flake8-todos (`TD`)

* flake8-fixme (`FIX`)

* pandas-vet (`PD`)

* ignore ANN101 ANN102 and ANN103

* Fix random_split tests

* Fix pre-commit

* ANN partly done

* Remove kwargs: Any

* flake8-annotations (`ANN`)

* Enabled tests

* Revert padim configs
* pyflakes

* pycodestyle

* pep8-naming (`N`)

* pyupgrade (`UP`)

* flake8-bandit (`S`)

* Enabled UP, ANN, S, BLE, FBT, B

* Fix typo

* Revert F1AdaptiveThreshold parent classes

* Fix some of the tests

* ignore boolean-positional-value-in-call (FBT003)

* Addressed pr comments

* Remove duplicated lines

* flake8-builtins (`A`) and flake8-commas (`COM`)

* flake8-comprehensions (`C4`)

* flake8-datatimez (`DTZ`), flake8-debugger (`T10`), flake8-errmsg (`EM`)

* flake8-pie (`PIE`)

* flake8-raise (`RSE`)

* flake8-return (`RET`)

* flake8-self (`SLF`)

* flake8-simplify (`SIM`)

* flake8-unsused-arguments (`ARG`)

* flake8-use-pathlib (`PTH`)

* eradicate (`ERA`)

* pylint (`PL`)

* tryceratos (`TRY`), flynt (`FLY`), Perflint (`PERF`)

* NumPy-specific rules (`NPY`)

* Ruff-specific rules (`RUF`)

* Remove pylint ignore comments

* Fix tests

* Fix tests

* mccabe (`C90`)

* pygrep-hooks (`PGH`)

* flake8-todos (`TD`)

* flake8-fixme (`FIX`)

* pandas-vet (`PD`)

* ignore ANN101 ANN102 and ANN103

* Fix random_split tests

* Fix pre-commit

* ANN partly done

* Remove kwargs: Any

* flake8-annotations (`ANN`)

* Enabled tests

* Revert padim configs

* Add auto fixes

* Fix docstrings

* Update src/anomalib/utils/metrics/binning.py

Co-authored-by: Ashwin Vaidya <ashwinnitinvaidya@gmail.com>

* Update src/anomalib/models/dfkde/lightning_model.py

Co-authored-by: Ashwin Vaidya <ashwinnitinvaidya@gmail.com>

* Update src/anomalib/models/rkde/feature_extractor.py

Co-authored-by: Ashwin Vaidya <ashwinnitinvaidya@gmail.com>

* Fixed pre-commit

---------

Co-authored-by: Ashwin Vaidya <ashwinnitinvaidya@gmail.com>
* Address tiler issues (#1411)

* fix tiler

* deprecate random tile locations

* restore random tiling in tile method

* check tiling section in config

* disable tiling for ganomalu

* pad -> padding

* Refactor Reverse Distillation to match official code (#1389)

* Non-mandatory early stopping

* Added conv4 and bn4 to OCBE

* Loss as in the official code (flattened arrays)

* Added comment on how to use torchvision model as an encoder to reproduce results in the paper

* Remove early stop from config, change default anomaly_map_mode to add

* pre-commit fix

* Updated results

* Update src/anomalib/models/reverse_distillation/README.md

Co-authored-by: Samet Akcay <samet.akcay@intel.com>

* Update src/anomalib/models/reverse_distillation/README.md

Co-authored-by: Samet Akcay <samet.akcay@intel.com>

* Update src/anomalib/models/reverse_distillation/README.md

Co-authored-by: Samet Akcay <samet.akcay@intel.com>

* Remove early_stopping

* Update src/anomalib/models/reverse_distillation/lightning_model.py

Co-authored-by: Samet Akcay <samet.akcay@intel.com>

* Easier to read code

---------

Co-authored-by: Samet Akcay <samet.akcay@intel.com>

---------

Co-authored-by: Dick Ameln <dick.ameln@intel.com>
Co-authored-by: abc-125 <63813435+abc-125@users.noreply.github.com>
Co-authored-by: Samet Akcay <samet.akcay@intel.com>
Co-authored-by: Ashwin Vaidya <ashwinitinvaidya@gmail.com>
* pyflakes

* pycodestyle

* pep8-naming (`N`)

* pyupgrade (`UP`)

* flake8-bandit (`S`)

* Enabled UP, ANN, S, BLE, FBT, B

* Fix typo

* Revert F1AdaptiveThreshold parent classes

* Fix some of the tests

* ignore boolean-positional-value-in-call (FBT003)

* Addressed pr comments

* Remove duplicated lines

* flake8-builtins (`A`) and flake8-commas (`COM`)

* flake8-comprehensions (`C4`)

* flake8-datatimez (`DTZ`), flake8-debugger (`T10`), flake8-errmsg (`EM`)

* flake8-pie (`PIE`)

* flake8-raise (`RSE`)

* flake8-return (`RET`)

* flake8-self (`SLF`)

* flake8-simplify (`SIM`)

* flake8-unsused-arguments (`ARG`)

* flake8-use-pathlib (`PTH`)

* eradicate (`ERA`)

* pylint (`PL`)

* tryceratos (`TRY`), flynt (`FLY`), Perflint (`PERF`)

* NumPy-specific rules (`NPY`)

* Ruff-specific rules (`RUF`)

* Remove pylint ignore comments

* Fix tests

* Fix tests

* mccabe (`C90`)

* pygrep-hooks (`PGH`)

* flake8-todos (`TD`)

* flake8-fixme (`FIX`)

* pandas-vet (`PD`)

* ignore ANN101 ANN102 and ANN103

* Fix random_split tests

* Fix pre-commit

* ANN partly done

* Remove kwargs: Any

* flake8-annotations (`ANN`)

* Enabled tests

* Revert padim configs

* Add auto fixes

* Fix docstrings

* Enabled "PLW2901",  # `for` loop variable `row` overwritten by assignment target
* pyflakes

* pycodestyle

* pep8-naming (`N`)

* pyupgrade (`UP`)

* flake8-bandit (`S`)

* Enabled UP, ANN, S, BLE, FBT, B

* Fix typo

* Revert F1AdaptiveThreshold parent classes

* Fix some of the tests

* ignore boolean-positional-value-in-call (FBT003)

* Addressed pr comments

* Remove duplicated lines

* flake8-builtins (`A`) and flake8-commas (`COM`)

* flake8-comprehensions (`C4`)

* flake8-datatimez (`DTZ`), flake8-debugger (`T10`), flake8-errmsg (`EM`)

* flake8-pie (`PIE`)

* flake8-raise (`RSE`)

* flake8-return (`RET`)

* flake8-self (`SLF`)

* flake8-simplify (`SIM`)

* flake8-unsused-arguments (`ARG`)

* flake8-use-pathlib (`PTH`)

* eradicate (`ERA`)

* pylint (`PL`)

* tryceratos (`TRY`), flynt (`FLY`), Perflint (`PERF`)

* NumPy-specific rules (`NPY`)

* Ruff-specific rules (`RUF`)

* Remove pylint ignore comments

* Fix tests

* Fix tests

* mccabe (`C90`)

* pygrep-hooks (`PGH`)

* flake8-todos (`TD`)

* flake8-fixme (`FIX`)

* pandas-vet (`PD`)

* ignore ANN101 ANN102 and ANN103

* Fix random_split tests

* Fix pre-commit

* ANN partly done

* Remove kwargs: Any

* flake8-annotations (`ANN`)

* Enabled tests

* Revert padim configs

* Add auto fixes

* Fix docstrings

* Enabled "PLW2901",  # `for` loop variable `row` overwritten by assignment target

* Add google style to pydocstyle

* Remove dashed line from Returns

* Remove dashed line from Args

* Remove dashed line from Example and Raises

* Removed left-over dashed lines

* Cleanup pyproject.toml file
* Add Verbosity Help-Formatter class

* Add Help-Formatter unit-tests

* Fix some strings

* Fix pre-commit ruff stuff

* Fix help_formatter's pre-commit
samet-akcay and others added 6 commits January 17, 2024 14:39
Fix metadata_path arg to metadata in OpenVINO inferencer
* Address path traversal issues 1-3

* address traversal path 6

* Address traverse path 8

* modify the comment to make it more descriptive

* Update get_image_filename function to enhance the input security

* fix example

* Fix incorrect default value assignment

* Refactor project_path fixture to create temporary directory in the root directory of the project

* Update .gitignore file to include test-related files and directories

* Refactor get_image_filenames_from_dir to filter out non-image files

* Add test case for path outside base directory

* Add examples to get_filenames

* Address PR comments.

* Renamed the tmp dir
* Add SECURITY.md file

* Add security item to the type of changes in the pull request template.

* Update pr template

* replace the security emoji
…1575)

* add clip normalization

* initial commit for winclip

* add cosine similarity computation

* add multiscale score computation

* simplify mask generation

* add few-shot extension (unvalidated)

* refactor

* cleanup

* add todo

* formatting

* minor refactor

* add comment

* expose optimal F1 metric

* some cleanup

* add ln_after_pool logic

* remove final_ln_after_pool

* update module docstring and remove comments

* add typing and docstrings to torch model

* cleanup lightning model

* hardcode backbone

* n_shot -> k_shot

* add temperature as constant

* minor bugfix

* add typing and docstrings to utils

* set class name dynamically

* replace inf values in harmonic aggregation

* run validate before test

* set default class name to None

* formatting

* remove config

* comments

* minor bugfix

* Revert "expose optimal F1 metric"

This reverts commit e8e1ead.

* more descriptive assert message

* expose scales as configurable parameter and hardcode pretrained as constant

* add readme

* add images for readme

* update docstrings

* update license headers

* ruff

* add openclip as requirement

* skip model tests for winclip

* fix visualizer test

* add example in docstring

* fix typo in function name

* typing

* imports

* docstrings

* check if model has trainer attribute

* remove pylint ignore statement

* typing

* docstring

* improve tensor shape handling

* refactor and rename class_scores function

* add docstring example

* commenting

* Update src/anomalib/models/image/winclip/torch_model.py

Co-authored-by: Samet Akcay <samet.akcay@intel.com>

* Update src/anomalib/models/image/winclip/torch_model.py

Co-authored-by: Samet Akcay <samet.akcay@intel.com>

* Update src/anomalib/models/image/winclip/torch_model.py

Co-authored-by: Samet Akcay <samet.akcay@intel.com>

* formatting

* docstrings

* docstrings

* comment

* typing

* multiscale -> multi_scale

* add winclip to docs

* add few_shot_source parameter

* use PredictDataset in WinCLIP implementation

* add learning type to winclip lightning model

* add custom model checkpoint callback to save at validation end

* remove trainer arguments from winclip model

* prune state dict for smaller model file

* add learning type logic to engine.train

* pass full path to model checkpoint

* remove training step

* enable integration tests for winclip

* fix typo

* index masks at 0

* formatting

* simplify make_masks

* validate inputs in make_masks

* add unit tests for winclip utils

* add default class_name to prompt ensemble

* add unit tests for winclip prompt ensemble

* add base class for normalization callback

* add _should_run_validation check

* add engine.model property

* use custom modelcheckpoint in tests

* update name in todos

* fix predict tests

* skip export tests for winclip

* fix mistake in model retrieval from trainer

* add model checks

* fix checks

* simplify model check

* add todo for winclip export

* add todo

* add bufferlist mixin

* update bufferlist docstring

* add setup method and register buffers

* import torch model in root of winclip module

* add unit tests for bufferlist mixin

* add unit tests for torch model

* fix transform and update docstring

* disable strict loading in export

* initialize embeddings as tensors

* add test to check if erors are raised

* add todo

* enable winclip export test

* remove device references in torch model

* restore frozen weights in load_state_dict

* make embedding collection methods private

* move state dict handling to winclip from base

* fix typo

* make generate_masks private

* increase onnx opset version

* remove future import

* update docstring

* Update src/anomalib/callbacks/normalization/__init__.py

Co-authored-by: Samet Akcay <samet.akcay@intel.com>

* Update src/anomalib/callbacks/normalization/cdf_normalization.py

Co-authored-by: Samet Akcay <samet.akcay@intel.com>

* Update src/anomalib/callbacks/normalization/min_max_normalization.py

Co-authored-by: Samet Akcay <samet.akcay@intel.com>

* Update src/anomalib/engine/engine.py

Co-authored-by: Samet Akcay <samet.akcay@intel.com>

* typing in docstrings

* Update src/anomalib/engine/engine.py

Co-authored-by: Samet Akcay <samet.akcay@intel.com>

* Update src/anomalib/engine/engine.py

Co-authored-by: Samet Akcay <samet.akcay@intel.com>

* Update src/anomalib/engine/engine.py

Co-authored-by: Samet Akcay <samet.akcay@intel.com>

* Update src/anomalib/engine/engine.py

Co-authored-by: Samet Akcay <samet.akcay@intel.com>

* use exception instead of assert

* update license header

* docstrings

* bufferlist -> buffer_list

---------

Co-authored-by: Samet Akcay <samet.akcay@intel.com>
give credit to related works
* Address tiler issues (#1411)

* fix tiler

* deprecate random tile locations

* restore random tiling in tile method

* check tiling section in config

* disable tiling for ganomalu

* pad -> padding

* Refactor Reverse Distillation to match official code (#1389)

* Non-mandatory early stopping

* Added conv4 and bn4 to OCBE

* Loss as in the official code (flattened arrays)

* Added comment on how to use torchvision model as an encoder to reproduce results in the paper

* Remove early stop from config, change default anomaly_map_mode to add

* pre-commit fix

* Updated results

* Update src/anomalib/models/reverse_distillation/README.md

Co-authored-by: Samet Akcay <samet.akcay@intel.com>

* Update src/anomalib/models/reverse_distillation/README.md

Co-authored-by: Samet Akcay <samet.akcay@intel.com>

* Update src/anomalib/models/reverse_distillation/README.md

Co-authored-by: Samet Akcay <samet.akcay@intel.com>

* Remove early_stopping

* Update src/anomalib/models/reverse_distillation/lightning_model.py

Co-authored-by: Samet Akcay <samet.akcay@intel.com>

* Easier to read code

---------

Co-authored-by: Samet Akcay <samet.akcay@intel.com>

* Patch for the WinError183 on the OpenVino export mode (#1386)

* Fix WinError183 (Windows Error)

* Add commentary of the change

---------

Co-authored-by: Youho99 <gaylord.giret@viacesi.fr>

* Add DSR model (#1142)

* added license, init.py and draft readme

* added draft DSR files

* minor comment update

* Implemented dsr model + comments

* added dsr discrete model

* added defect generation in torch model + dsr to list of existing methods in init.py

* fixed torch model, started implementing lightning model, implemented anomaly generator

* added loss file for DSR

* Added loss, improved lightning module

* Finished up global implementation of DSR second phase

* minor fixes

* Bugfixes

* Fixed DSR loss calculation

* on_training_start -> on_train_start

* pre-commit run

* updated DSR documentation

* reset config file

* added automatic pretraining weight download

* testing pretrained weights. fixed embedding size in upsampling module and image recon module, to be fixed in original branch

* successful testing on pretrained dsr weights

* checked test quality with pretrained weights, fixed anomaly score calculation

* training is functional

* Fixed training procedure

* test still working

* working upsampling module training and testing

* fixed minor bugs

* updated documentation

* added tests and doc

* adapted learning schedule to steps

* Update src/anomalib/models/dsr/anomaly_generator.py

Co-authored-by: Ashwin Vaidya <ashwinnitinvaidya@gmail.com>

* Apply suggestions from code review

Co-authored-by: Samet Akcay <samet.akcay@intel.com>
Co-authored-by: Ashwin Vaidya <ashwinnitinvaidya@gmail.com>

* refactored outputs into dicts

* remove super() args

* changed downloading weights from anomalib releases + minor fixes

* pre commit hooks + minor fixes

* removed configurable ckpt path refs + default iteration nb from paper

* cleaned up dsr.rst and turned exceptions into RuntimeErrors

* Added upsampling ratio parameter to set third training phase epochs

* Added batched evalaution + minor code simplification

* pre commit hooks

* squeeze output image score tensor

* readded new path check in efficient ad

* fixed double step count with manual optimization

* fixed trailing whitespace

* Fix black issues

* Apply suggestions from code review

Co-authored-by: Samet Akcay <samet.akcay@intel.com>

* review suggestions

* updated architecture image links

* Address mypy

* changed output types for dsr model

* readded dict outputs, adapted to TorchInferencer

* fixed error in output dict

* removed default imagenet norm

---------

Co-authored-by: Samet Akcay <samet.akcay@intel.com>
Co-authored-by: Ashwin Vaidya <ashwinnitinvaidya@gmail.com>

* Fix unexpected key pixel_metrics.AUPRO.fpr_limit (#1055)

* fix unexpected key pixel_metrics.AUPRO.fpr_limit

Signed-off-by: FanJiangIntel <fan.jiang@intel.com>

* load AUPRO before create_metric_collection

Signed-off-by: FanJiangIntel <fan.jiang@intel.com>

* code refine

Signed-off-by: FanJiangIntel <fan.jiang@intel.com>

* fix comment

Signed-off-by: FanJiangIntel <fan.jiang@intel.com>

* fix

Signed-off-by: FanJiangIntel <fan.jiang@intel.com>

* Support test

Signed-off-by: Kang Wenjing <wenjing.kang@intel.com>

* Update test

Signed-off-by: Kang Wenjing <wenjing.kang@intel.com>

* Update test

Signed-off-by: Kang Wenjing <wenjing.kang@intel.com>

---------

Signed-off-by: FanJiangIntel <fan.jiang@intel.com>
Signed-off-by: Kang Wenjing <wenjing.kang@intel.com>
Co-authored-by: FanJiangIntel <fan.jiang@intel.com>
Co-authored-by: Samet Akcay <samet.akcay@intel.com>

* Improved speed and memory usage of mean+std calculation (#1457)

* preexisting OpenCV version check added to `setup.py`, ran formatting pre-commit hooks on previous contribution. (#1424)

* testing upstream switch

* picked up on stale OpenCV `setup.py` issue #1041

* 🐞 Hotfix: Limit Gradio Version (#1458)

* Fix metadata path

* Ignore hidden directories in folder dataset

* Add check for mask_dir for segmentation tasks in Folder dataset

* Limit the gradio version to <4

* Fix/efficient ad normalize before every validation (#1441)

* Normalize anomaly maps before every validation

* Remove print statement

---------

Co-authored-by: Samet Akcay <samet.akcay@intel.com>

* Fix DRAEM (#1431)

* Fix beta in augmenter

* Add scheduler

* Change normalization to none

* Replace two lr schedulers with MultiStepLR

* Revert change to beta

* Disable early stopping default

* Format config

* Add opacity parameter beta to config

* Adding U-Flow method (#1415)

* Added uflow model

* Added documentation (README) for uflow model

* Added uflow to the list of available models, and main README updated

* Added missing images for the documentation

* Update src/anomalib/models/uflow/anomaly_map.py

Co-authored-by: Samet Akcay <samet.akcay@intel.com>

* Update src/anomalib/models/uflow/anomaly_map.py

Co-authored-by: Samet Akcay <samet.akcay@intel.com>

* Update src/anomalib/models/uflow/feature_extraction.py

Co-authored-by: Samet Akcay <samet.akcay@intel.com>

* Update src/anomalib/models/uflow/torch_model.py

Co-authored-by: Samet Akcay <samet.akcay@intel.com>

* Added uflow to the reference guide in docs

* Added uflow to the pre-merge tests

* removed the _step function, and merged the code with training_step

* added as a comment the values used in the paper

* re-factorized feature extractors to use the TimmFeatureExtractor class

* added annotations for some functions, where the flow graph is created

* updated readme to fix images loading

* Added link in the README to the original code for reproducing the results

* Removed unused kwargs

* Added docstrigs with args explanations to UFlow classes

* Added models in a github release, and linked here

* Passing all pre-commit checks

* Changed freia's AllInOneBlock by Anomalib's version, and converted the subnet contructor to a Class, in order to be pickable, that is needed to export the model to torch

---------

Co-authored-by: Samet Akcay <samet.akcay@intel.com>

* Update README.md

* πŸ“˜ Announce anomalib v1 on the main `README.md` (#1542)

* Fix metadata path

* Ignore hidden directories in folder dataset

* Add check for mask_dir for segmentation tasks in Folder dataset

* Limit the gradio version to <4

* Announce anomalib v1 on readme

* Add the installation instructions and update the documentation link

* Fixed DSR (#1486)

* fixed DSR squeeze bug

* added comment

* Refactor/extensions custom dataset (#1562)

* Explanation how to use extension names in the config file

* Added information about extensions to the error message and control of the user input

* Easier to read code

* Replacing assert with raise

* πŸ“š Modify the PR template (#1611)

Update pull_request_template.md

* Fix result image URLs (#1510)

* Fix tests

* refactor path + fix issues + fix linting issues

* Migrate docs

* fix typing

* fix failing model tests

* Fix tests

* Address PR comments

* Fixed shape error, allowing arbitary image sizes for EfficientAD (#1537)

* Fixed shape error, allowing arbitrary image sizes. Replaced integer parsing by floor operation

* Replaced calculation by ceil operation. Solution of shape error is to round up and not down for the last upsample layer

* Add comment for ceil oepration

* Formatting with pre-commit hook

* Clean up badge

---------

Signed-off-by: FanJiangIntel <fan.jiang@intel.com>
Signed-off-by: Kang Wenjing <wenjing.kang@intel.com>
Co-authored-by: Dick Ameln <dick.ameln@intel.com>
Co-authored-by: abc-125 <63813435+abc-125@users.noreply.github.com>
Co-authored-by: Samet Akcay <samet.akcay@intel.com>
Co-authored-by: ggiret-thinkdeep <146845847+ggiret-thinkdeep@users.noreply.github.com>
Co-authored-by: Youho99 <gaylord.giret@viacesi.fr>
Co-authored-by: Philippe Carvalho <31983398+phcarval@users.noreply.github.com>
Co-authored-by: Wenjing Kang <wenjing.kang@intel.com>
Co-authored-by: FanJiangIntel <fan.jiang@intel.com>
Co-authored-by: belfner <belfner@belfner.com>
Co-authored-by: Abdulla Al Blooshi <76493346+abdullamatar@users.noreply.github.com>
Co-authored-by: BlaΕΎ Rolih <61357777+blaz-r@users.noreply.github.com>
Co-authored-by: MatΓ­as Tailanian <895687+mtailanian@users.noreply.github.com>
Co-authored-by: Jan SchlΓΌter <github@jan-schlueter.de>
Co-authored-by: Ashwin Vaidya <ashwinitinvaidya@gmail.com>
Co-authored-by: Christopher <48522299+holzweber@users.noreply.github.com>
Copy link

Check out this pull request onΒ  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link

codecov bot commented Jan 24, 2024

Codecov Report

Attention: 195 lines in your changes are missing coverage. Please review.

Comparison is base (8fd7cc0) 83.21% compared to head (3efc0ba) 83.16%.
Report is 19 commits behind head on main.

Files Patch % Lines
src/anomalib/models/image/dsr/torch_model.py 80.10% 75 Missing ⚠️
src/anomalib/models/image/uflow/anomaly_map.py 45.45% 30 Missing ⚠️
src/anomalib/models/image/dsr/anomaly_generator.py 40.00% 18 Missing ⚠️
...c/anomalib/models/image/winclip/lightning_model.py 77.63% 17 Missing ⚠️
.../anomalib/models/image/uflow/feature_extraction.py 78.37% 16 Missing ⚠️
src/anomalib/engine/engine.py 75.00% 11 Missing ⚠️
src/anomalib/models/image/winclip/torch_model.py 93.18% 9 Missing ⚠️
src/anomalib/models/image/dsr/lightning_model.py 90.90% 7 Missing ⚠️
src/anomalib/models/image/dsr/loss.py 73.68% 5 Missing ⚠️
src/anomalib/data/utils/transforms.py 33.33% 2 Missing ⚠️
... and 4 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1663      +/-   ##
==========================================
- Coverage   83.21%   83.16%   -0.06%     
==========================================
  Files         219      230      +11     
  Lines        9412    10156     +744     
==========================================
+ Hits         7832     8446     +614     
- Misses       1580     1710     +130     

β˜” View full report in Codecov by Sentry.
πŸ“’ Have feedback on the report? Share it here.

@samet-akcay samet-akcay merged commit bf0ee14 into main Jan 24, 2024
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants