Skip to content

Commit

Permalink
Merge branch 'main' into ov-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianboguszewski authored Feb 9, 2024
2 parents ab5a35f + 241c147 commit deeecbb
Show file tree
Hide file tree
Showing 57 changed files with 1,434 additions and 524 deletions.
2 changes: 2 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ Before you submit your pull request, please make sure you have completed the fol
- [ ] 📋 I have summarized my changes in the [CHANGELOG](https://github.com/openvinotoolkit/anomalib/blob/main/CHANGELOG.md) 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).

For more information about code review checklists, see the [Code Review Checklist](../docs/source/markdown/guides/developer/code_review_checklist.md).
19 changes: 14 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,19 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
- name: Import GPG Key
run: |
echo "${{ secrets.GPG_PRIVATE_KEY }}" | base64 --decode | gpg --import
- name: Build and sign distribution
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
gpg --detach-sign -a dist/*.tar.gz
gpg --detach-sign -a dist/*.whl
- name: Upload to PyPI
run: twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ repos:
additional_dependencies: [types-PyYAML]
exclude: "tests"

# add bandit for security checks
- repo: https://github.com/PyCQA/bandit
rev: 1.7.7
hooks:
- id: bandit
args: ["-c", "pyproject.toml"]
additional_dependencies: ["bandit[toml]"]

# notebooks.
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.7.0
Expand Down
81 changes: 80 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,95 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### Added

- 🚀 Add KMeans PyTorch Implementation to cfa model by @aadhamm in https://github.com/openvinotoolkit/anomalib/pull/998
- 🚀 Add DSR model by @phcarval in https://github.com/openvinotoolkit/anomalib/pull/1142
- ⚙️ Add `setuptools` as a requirement (via `pkg_resources`) by @murilo-cunha in https://github.com/openvinotoolkit/anomalib/pull/1168
- 🚀 Add support to backbone URI in config. by @mzweilin in https://github.com/openvinotoolkit/anomalib/pull/1343
- ⚙️ Add extra checks to `TorchInferencer` model and metadata loading by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/1350
- ⚙️ Handle `dict` objects in `TorchInferencer` by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/1354
- ⚙️ Add tag to workflow by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/1382
- 🚀 Adding U-Flow method by @mtailanian in https://github.com/openvinotoolkit/anomalib/pull/1415
- 🚀 V1 by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/1663
- 📚 Announce anomalib v1 on the main `README.md` by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/1542
- 📚 Add docs for the depth data by @willyfh in https://github.com/openvinotoolkit/anomalib/pull/1694
- 📚 Add docs for the U-Flow model by @willyfh in https://github.com/openvinotoolkit/anomalib/pull/1695
- 📚 Add docs for the DSR model by @willyfh in https://github.com/openvinotoolkit/anomalib/pull/1700
- 📚 Add news section to docs by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/1689

### Changed

- Changed default inference device to AUTO in https://github.com/openvinotoolkit/anomalib/pull/1534
- 🔨 Version bump by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/1305
- 🔨 Modify README custom dataset by @Kiminjo in https://github.com/openvinotoolkit/anomalib/pull/1314
- 🔨 Change the documentation URL in `README.md` and add commands to run each inferencer by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/1326
- 🔨 Allow dynamic batch-sizes when exporting to ONNX, instead if fixed input shapes by @BeeAlarmed in https://github.com/openvinotoolkit/anomalib/pull/1347
- 🔨 README: Synchronize OV version with requirements by @sovrasov in https://github.com/openvinotoolkit/anomalib/pull/1358
- 🔨 update timm to 0.6.13 by @Gornoka in https://github.com/openvinotoolkit/anomalib/pull/1373
- 🔨 Refactor Reverse Distillation to match official code by @abc-125 in https://github.com/openvinotoolkit/anomalib/pull/1389
- 🔨 Address tiler issues by @djdameln in https://github.com/openvinotoolkit/anomalib/pull/1411
- 🔨 preexisting OpenCV version check added to `setup.py`, ran formatting pre-commit hooks on previous contribution. by @abdullamatar in https://github.com/openvinotoolkit/anomalib/pull/1424
- 🔨 Improved speed and memory usage of mean+std calculation by @belfner in https://github.com/openvinotoolkit/anomalib/pull/1457
- 🔨 Changed default inference device to AUTO in https://github.com/openvinotoolkit/anomalib/pull/1534
- 🔨 Refactor/extensions custom dataset by @abc-125 in https://github.com/openvinotoolkit/anomalib/pull/1562
- 📚 Modify the PR template by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/1611
- 📚 Remove github pages by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/1667
- 🔒 Validate path before processing by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/1668
- 📚 Update RKDE lighting model file header (hence docs) with paper URL by @tobybreckon in https://github.com/openvinotoolkit/anomalib/pull/1671
- 🔒 Address checkmarx issues. by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/1672
- 📚 Update contribution guidelines by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/1677
- 🔨 Refactor Visualisation by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/1693

### Deprecated

- Support only Python 3.10 and greater in https://github.com/openvinotoolkit/anomalib/pull/1299

### Fixed

- 🐞 Fix unexpected key pixel_metrics.AUPRO.fpr_limit by @WenjingKangIntel in https://github.com/openvinotoolkit/anomalib/pull/1055
- 📚 Fix docs build by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/1307
- 🐞 Fix tiling for Reverse Distillation and STFPM by @blaz-r in https://github.com/openvinotoolkit/anomalib/pull/1319
- 📚 Fix the readthedocs config by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/1322
- 🐞 Fix PRO metric calculation on GPU by @blaz-r in https://github.com/openvinotoolkit/anomalib/pull/1317
- 🐞 Fix dockerfile cuda version by @phcarval in https://github.com/openvinotoolkit/anomalib/pull/1330
- 🐞 Fix patchcore interpolation by @jpcbertoldo in https://github.com/openvinotoolkit/anomalib/pull/1335
- 🔨 Efficient ad reduced memory footprint by @MG109 in https://github.com/openvinotoolkit/anomalib/pull/1340
- 📚 Fix(docs): typo by @pirnerjonas in https://github.com/openvinotoolkit/anomalib/pull/1353
- 🐞 Fix EfficientAD to use width and height of the input by @abc-125 in https://github.com/openvinotoolkit/anomalib/pull/1355
- 📚 Fix the broken link in training.rst by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/1363
- 📚 Missing indentation in metrics.rst docs by @caiolang in https://github.com/openvinotoolkit/anomalib/pull/1379
- 🐞 Patch for the WinError183 on the OpenVino export mode by @ggiret-thinkdeep in https://github.com/openvinotoolkit/anomalib/pull/1386
- 🐞 Fix DRAEM by @blaz-r in https://github.com/openvinotoolkit/anomalib/pull/1431
- 🐞 Fix/efficient ad normalize before every validation by @abc-125 in https://github.com/openvinotoolkit/anomalib/pull/1441
- 🐞 Hotfix: Limit Gradio Version by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/1458
- 🔨 Fixed DSR by @phcarval in https://github.com/openvinotoolkit/anomalib/pull/1486
- 📚 Fix result image URLs by @f0k in https://github.com/openvinotoolkit/anomalib/pull/1510
- 🐞 Fix broken 501 notebooks by @adrianboguszewski in https://github.com/openvinotoolkit/anomalib/pull/1630
- 🐞 Fixed shape error, allowing arbitary image sizes for EfficientAD by @holzweber in https://github.com/openvinotoolkit/anomalib/pull/1537
- 📚 Fix the broken images on `README.md` by @samet-akcay in https://github.com/openvinotoolkit/anomalib/pull/1666
- 🐞 Fix GMM test by @ashwinvaidya17 in https://github.com/openvinotoolkit/anomalib/pull/1696
- 📚 Fix indentation and add license for the ShanghaiTech Campus Dataset by @willyfh in https://github.com/openvinotoolkit/anomalib/pull/1701

### New Contributors

- @Kiminjo made their first contribution in https://github.com/openvinotoolkit/anomalib/pull/1314
- @murilo-cunha made their first contribution in https://github.com/openvinotoolkit/anomalib/pull/1168
- @aadhamm made their first contribution in https://github.com/openvinotoolkit/anomalib/pull/998
- @MG109 made their first contribution in https://github.com/openvinotoolkit/anomalib/pull/1340
- @BeeAlarmed made their first contribution in https://github.com/openvinotoolkit/anomalib/pull/1347
- @pirnerjonas made their first contribution in https://github.com/openvinotoolkit/anomalib/pull/1353
- @sovrasov made their first contribution in https://github.com/openvinotoolkit/anomalib/pull/1358
- @abc-125 made their first contribution in https://github.com/openvinotoolkit/anomalib/pull/1355
- @Gornoka made their first contribution in https://github.com/openvinotoolkit/anomalib/pull/1373
- @caiolang made their first contribution in https://github.com/openvinotoolkit/anomalib/pull/1379
- @ggiret-thinkdeep made their first contribution in https://github.com/openvinotoolkit/anomalib/pull/1386
- @belfner made their first contribution in https://github.com/openvinotoolkit/anomalib/pull/1457
- @abdullamatar made their first contribution in https://github.com/openvinotoolkit/anomalib/pull/1424
- @mtailanian made their first contribution in https://github.com/openvinotoolkit/anomalib/pull/1415
- @f0k made their first contribution in https://github.com/openvinotoolkit/anomalib/pull/1510
- @holzweber made their first contribution in https://github.com/openvinotoolkit/anomalib/pull/1537
- @tobybreckon made their first contribution in https://github.com/openvinotoolkit/anomalib/pull/1671

**Full Changelog**: https://github.com/openvinotoolkit/anomalib/compare/v0.7.0...v1.0.0

## [v0.7.0] - 2023-08-28

### Added
Expand Down
105 changes: 78 additions & 27 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ We want to make it as simple and straightforward as possible to contribute to th

## 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=&projects=&template=bug_report.yaml&title=%5BBug%5D%3A+).

## Discussion

Expand All @@ -26,50 +26,101 @@ We utilize GitHub issues to track the feature requests as well. If you are certa

We actively welcome your pull requests:

1. Fork the repo and create your branch from [`main`](https://github.com/openvinotoolkit/anomalib/tree/main).
1. Set up the development environment by following the instructions below.
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 you own the code you're submitting or that you obtain it from a source with an appropriate license.
1. Add a summary of the changes to the [CHANGELOG](https://github.com/openvinotoolkit/anomalib/blob/main/CHANGELOG.md) (not for minor changes, docs and tests).
1. Issue that pull request!
###  Getting Started

### Setting up the development environment and using pre-commit
#### 1. Fork and Clone the Repository

To setup the development environment, you will need to install development requirements, as well as the base requirements of the library.
First, fork the Anomalib repository by following the GitHub documentation on [forking a repo](https://docs.github.com/en/enterprise-cloud@latest/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo). Then, clone your forked repository to your local machine and create a new branch from `main`.

```bash
conda create -n anomalib_dev python=3.10
conda activate anomalib_dev
pip install -r requirements/base.txt -r requirements/dev.txt
pre-commit install
```
#### 2. Set Up Your Development Environment

Set up your development environment to start contributing. This involves installing the required dependencies and setting up pre-commit hooks for code quality checks. Note that this guide assumes you are using [Conda](https://docs.conda.io/en/latest/) for package management. However, the steps are similar for other package managers.

<details>
<summary>Development Environment Setup Instructions</summary>

1. Create and activate a new Conda environment:

```bash
conda create -n anomalib_dev python=3.10
conda activate anomalib_dev
```

2. Install the base and development requirements:

The commands above will install pre-commit. Pre-commit hooks will run each of the code quality tools listed above 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.
```bash
pip install -r requirements/base.txt -r requirements/dev.txt
```

The pre-commit checks can also be triggered manually with the following command:
Optionally, for a full installation with all dependencies:

```bash
pip install -e .[all]
```

3. Install and configure pre-commit hooks:

```bash
pre-commit install
```

Pre-commit hooks help ensure code quality and consistency. After each commit,
`pre-commit` will automatically run the configured checks for the changed file.
If you would like to manually run the checks for all files, use:

```bash
pre-commit run --all-files
```

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.
To bypass pre-commit hooks temporarily (e.g., for a work-in-progress commit),
use:

```bash
git commit -m 'WIP commit' --no-verify
```

When doing so, please make sure to revisit the pre-commit issues before you submit your PR. A good way to confirm if your code passes the checks is by running `pre-commit run --all-files`.
However, make sure to address any pre-commit issues before finalizing your pull request.

More information on pre-commit and how it is used in Anomalib can be found in our documentation:
</details>

- [Pre-commit hooks guide](https://openvinotoolkit.github.io/anomalib/developer_guide/pre_commit_hooks.html)
### Making Changes

## License
1. **Write Code:** Follow the project's coding standards and write your code with clear intent. Ensure your code is well-documented and includes examples where appropriate. For code quality we use ruff, whose configuration is in [`pyproject.toml`](https://github.com/openvinotoolkit/anomalib/blob/main/pyproject.toml) file.
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.
2. **Add Tests:** If your code includes new functionality, add corresponding tests using [pytest](https://docs.pytest.org/en/7.4.x/) to maintain coverage and reliability.
3. **Update Documentation:** If you've changed APIs or added new features, update the documentation accordingly. Ensure your docstrings are clear and follow [Google's docstring guide](https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings).
## References
4. **Pass Tests and Quality Checks:** Ensure the test suite passes and that your code meets quality standards by running:
This document was adapted from [here](https://gist.github.com/briandk/3d2e8b3ec8daf5a27a62).
```bash
pre-commit run --all-files
pytest tests/
```
5. **Update the Changelog:** For significant changes, add a summary to the [CHANGELOG](https://github.com/openvinotoolkit/anomalib/blob/main/CHANGELOG.md).
6. **Check Licensing:** Ensure you own the code or have rights to use it, adhering to appropriate licensing.
7. **Sign Your Commits:** Use signed commits to certify that you have the right to submit the code under the project's license:

```bash
git commit -S -m "Your detailed commit message"
```

For more on signing commits, see [GitHub's guide on signing commits](https://docs.github.com/en/github/authenticating-to-github/managing-commit-signature-verification/signing-commits).
### Submitting Pull Requests
Once you've followed the above steps and are satisfied with your changes:

1. Push your changes to your forked repository.
2. Go to the original Anomalib repository you forked and click "New pull request".
3. Choose your fork and the branch with your changes to open a pull request.
4. Fill in the pull request template with the necessary details about your changes.

We look forward to your contributions!

## 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.
Loading

0 comments on commit deeecbb

Please sign in to comment.