Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.3%) to scientific vocabulary
Last synced: 6 months ago · JSON representation ·

Repository

Basic Info
  • Host: GitHub
  • Owner: Hie1991
  • License: apache-2.0
  • Language: Python
  • Default Branch: main
  • Size: 61 MB
Statistics
  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • Open Issues: 1
  • Releases: 0
Created 9 months ago · Last pushed 9 months ago
Metadata Files
Readme Changelog Contributing License Code of conduct Citation Codeowners Security Governance

README.md

Anomalib Logo - A deep learning library for anomaly detection **A library for benchmarking, developing and deploying deep learning anomaly detection algorithms** --- [Key Features](#key-features) • [Docs](https://anomalib.readthedocs.io/en/latest/) • [Notebooks](examples/notebooks) • [License](LICENSE) [![python](https://img.shields.io/badge/python-3.10%2B-green)]() [![pytorch](https://img.shields.io/badge/pytorch-2.0%2B-orange)]() [![lightning](https://img.shields.io/badge/lightning-2.2%2B-blue)]() [![openvino](https://img.shields.io/badge/openvino-2024.0%2B-purple)]() [![Pre-Merge Checks](https://github.com/open-edge-platform/anomalib/actions/workflows/pre_merge.yml/badge.svg)](https://github.com/open-edge-platform/anomalib/actions/workflows/pre_merge.yml) [![codecov](https://codecov.io/gh/open-edge-platform/anomalib/branch/main/graph/badge.svg?token=Z6A07N1BZK)](https://codecov.io/gh/open-edge-platform/anomalib) [![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) [![snyk](https://snyk.io/advisor/python/anomalib/badge.svg)](https://snyk.io/advisor/python/anomalib) [![ReadTheDocs](https://readthedocs.org/projects/anomalib/badge/?version=latest)](https://anomalib.readthedocs.io/en/latest/?badge=latest) [![Anomalib - Gurubase docs](https://img.shields.io/badge/Gurubase-Ask%20Anomalib%20Guru-006BFF)](https://gurubase.io/g/anomalib) open-edge-platform%2Fanomalib | Trendshift

🌟 Announcing v2.0.0 Release! 🌟

We're excited to announce the release of Anomalib v2.0.0! This version introduces significant improvements and customization options to enhance your anomaly detection workflows. Please be aware that there are several API changes between v1.2.0 and v2.0.0, so please be careful when updating your existing pipelines. Key features include:

We value your input! Please share feedback via GitHub Issues or our Discussions

👋 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 visual anomaly detection, where the goal of the algorithm is to detect and/or localize anomalies within images or videos in a dataset. Anomalib is constantly updated with new algorithms and training/inference extensions, so keep checking!

A prediction made by anomalib

Key features

  • Simple and modular API and CLI for training, inference, benchmarking, and hyperparameter optimization.
  • The largest public collection of ready-to-use deep learning anomaly detection algorithms and benchmark datasets.
  • Lightning based model implementations to reduce boilerplate code and limit the implementation efforts to the bare essentials.
  • The majority of models can be exported to OpenVINO Intermediate Representation (IR) for accelerated inference on Intel hardware.
  • A set of inference tools for quick and easy deployment of the standard or custom anomaly detection models.

📦 Installation

Anomalib provides multiple installation options to suit your needs. Choose the one that best fits your requirements:

🚀 Install from PyPI

```bash

Basic installation from PyPI

pip install anomalib

Full installation with all dependencies

pip install anomalib[full] ```

🔧 Install from Source

For contributing or customizing the library:

```bash git clone https://github.com/open-edge-platform/anomalib.git cd anomalib pip install -e .

Full development installation with all dependencies

pip install -e .[full] ```

🧠 Training

Anomalib supports both API and CLI-based training approaches:

🔌 Python API

```python from anomalib.data import MVTecAD from anomalib.models import Patchcore from anomalib.engine import Engine

Initialize components

datamodule = MVTecAD() model = Patchcore() engine = Engine()

Train the model

engine.fit(datamodule=datamodule, model=model) ```

⌨️ Command Line

```bash

Train with default settings

anomalib train --model Patchcore --data anomalib.data.MVTecAD

Train with custom category

anomalib train --model Patchcore --data anomalib.data.MVTecAD --data.category transistor

Train with config file

anomalib train --config path/to/config.yaml ```

🤖 Inference

Anomalib provides multiple inference options including Torch, Lightning, Gradio, and OpenVINO. Here's how to get started:

🔌 Python API

```python

Load model and make predictions

predictions = engine.predict( datamodule=datamodule, model=model, ckpt_path="path/to/checkpoint.ckpt", ) ```

⌨️ Command Line

```bash

Basic prediction

anomalib predict --model anomalib.models.Patchcore \ --data anomalib.data.MVTecAD \ --ckpt_path path/to/model.ckpt

Prediction with results

anomalib predict --model anomalib.models.Patchcore \ --data anomalib.data.MVTecAD \ --ckptpath path/to/model.ckpt \ --returnpredictions ```

📘 Note: For advanced inference options including Gradio and OpenVINO, check our Inference Documentation.

Training on Intel GPUs

[!Note] Currently, only single GPU training is supported on Intel GPUs. These commands were tested on Arc 750 and Arc 770.

Ensure that you have PyTorch with XPU support installed. For more information, please refer to the PyTorch XPU documentation

🔌 API

```python from anomalib.data import MVTecAD from anomalib.engine import Engine, SingleXPUStrategy, XPUAccelerator from anomalib.models import Stfpm

engine = Engine( strategy=SingleXPUStrategy(), accelerator=XPUAccelerator(), ) engine.train(Stfpm(), datamodule=MVTecAD()) ```

⌨️ CLI

bash anomalib train --model Padim --data MVTecAD --trainer.accelerator xpu --trainer.strategy xpu_single

⚙️ Hyperparameter Optimization

Anomalib supports hyperparameter optimization (HPO) using Weights & Biases and Comet.ml.

```bash

Run HPO with Weights & Biases

anomalib hpo --backend WANDB --sweep_config tools/hpo/configs/wandb.yaml ```

📘 Note: For detailed HPO configuration, check our HPO Documentation.

🧪 Experiment Management

Track your experiments with popular logging platforms through PyTorch Lightning loggers:

  • 📊 Weights & Biases
  • 📈 Comet.ml
  • 📉 TensorBoard

Enable logging in your config file to track:

  • Hyperparameters
  • Metrics
  • Model graphs
  • Test predictions

📘 Note: For logging setup, see our Logging Documentation.

📊 Benchmarking

Evaluate and compare model performance across different datasets:

```bash

Run benchmarking with default configuration

anomalib benchmark --config tools/benchmarking/benchmark_params.yaml ```

💡 Tip: Check individual model performance in their respective README files:

✍️ Reference

If you find Anomalib useful in your research or work, please cite:

tex @inproceedings{akcay2022anomalib, title={Anomalib: A deep learning library for anomaly detection}, author={Akcay, Samet and Ameln, Dick and Vaidya, Ashwin and Lakshmanan, Barath and Ahuja, Nilesh and Genc, Utku}, booktitle={2022 IEEE International Conference on Image Processing (ICIP)}, pages={1706--1710}, year={2022}, organization={IEEE} }

👥 Contributing

We welcome contributions! Check out our Contributing Guide to get started.

Contributors to open-edge-platform/anomalib

Thank you to all our contributors!

Owner

  • Login: Hie1991
  • Kind: user

Citation (CITATION.cff)

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: "Anomalib: A Deep Learning Library for Anomaly Detection"
message: "If you use this library and love it, cite the software and the paper \U0001F917"
authors:
  - given-names: Samet
    family-names: Akcay
    email: samet.akcay@intel.com
    affiliation: Intel
  - given-names: Dick
    family-names: Ameln
    email: dick.ameln@intel.com
    affiliation: Intel
  - given-names: Ashwin
    family-names: Vaidya
    email: ashwin.vaidya@intel.com
    affiliation: Intel
  - given-names: Barath
    family-names: Lakshmanan
    email: barath.lakshmanan@intel.com
    affiliation: Intel
  - given-names: Nilesh
    family-names: Ahuja
    email: nilesh.ahuja@intel.com
    affiliation: Intel
  - given-names: Utku
    family-names: Genc
    email: utku.genc@intel.com
    affiliation: Intel
version: 0.2.6
doi: https://doi.org/10.48550/arXiv.2202.08341
date-released: 2022-02-18
references:
  - type: article
    authors:
      - given-names: Samet
        family-names: Akcay
        email: samet.akcay@intel.com
        affiliation: Intel
      - given-names: Dick
        family-names: Ameln
        email: dick.ameln@intel.com
        affiliation: Intel
      - given-names: Ashwin
        family-names: Vaidya
        email: ashwin.vaidya@intel.com
        affiliation: Intel
      - given-names: Barath
        family-names: Lakshmanan
        email: barath.lakshmanan@intel.com
        affiliation: Intel
      - given-names: Nilesh
        family-names: Ahuja
        email: nilesh.ahuja@intel.com
        affiliation: Intel
      - given-names: Utku
        family-names: Genc
        email: utku.genc@intel.com
        affiliation: Intel
    title: "Anomalib: A Deep Learning Library for Anomaly Detection"
    year: 2022
    journal: ArXiv
    doi: https://doi.org/10.48550/arXiv.2202.08341
    url: https://arxiv.org/abs/2202.08341

abstract: >-
  This paper introduces anomalib, a novel library for
  unsupervised anomaly detection and localization.
  With reproducibility and modularity in mind, this
  open-source library provides algorithms from the
  literature and a set of tools to design custom
  anomaly detection algorithms via a plug-and-play
  approach. Anomalib comprises state-of-the-art
  anomaly detection algorithms that achieve top
  performance on the benchmarks and that can be used
  off-the-shelf. In addition, the library provides
  components to design custom algorithms that could
  be tailored towards specific needs. Additional
  tools, including experiment trackers, visualizers,
  and hyper-parameter optimizers, make it simple to
  design and implement anomaly detection models. The
  library also supports OpenVINO model optimization
  and quantization for real-time deployment. Overall,
  anomalib is an extensive library for the design,
  implementation, and deployment of unsupervised
  anomaly detection models from data to the edge.
keywords:
  - Unsupervised Anomaly detection
  - Unsupervised Anomaly localization
license: Apache-2.0

GitHub Events

Total
  • Delete event: 1
  • Issue comment event: 2
  • Push event: 1
  • Pull request event: 5
  • Create event: 5
Last Year
  • Delete event: 1
  • Issue comment event: 2
  • Push event: 1
  • Pull request event: 5
  • Create event: 5

Dependencies

.github/actions/code-quality/pre-commit/action.yaml actions
  • actions/cache v3 composite
  • actions/setup-node v4 composite
  • actions/setup-python v5 composite
.github/actions/pytest/action.yaml actions
  • actions/setup-python v5 composite
  • actions/upload-artifact v4 composite
.github/actions/security/bandit/action.yaml actions
  • actions/setup-python 8d9ed9ac5c53483de85588cdf95a591a75ab9f55 composite
  • actions/upload-artifact v4 composite
  • github/codeql-action/upload-sarif 1b549b9259bda1cb5ddde3b41741a82a2d15a841 composite
  • tj-actions/changed-files 823fcebdb31bb35fdf2229d9f769b400309430d0 composite
.github/actions/security/clamav/action.yaml actions
  • actions/upload-artifact v4 composite
  • docker://clamav/clamav stable composite
  • tj-actions/changed-files ed68ef82c095e0d48ec87eccea555d944a631a4c composite
.github/actions/security/semgrep/action.yaml actions
  • actions/upload-artifact v4 composite
  • github/codeql-action/upload-sarif 1b549b9259bda1cb5ddde3b41741a82a2d15a841 composite
  • tj-actions/changed-files 823fcebdb31bb35fdf2229d9f769b400309430d0 composite
.github/actions/security/trivy/action.yaml actions
  • actions/cache v3 composite
  • tj-actions/changed-files ed68ef82c095e0d48ec87eccea555d944a631a4c composite
.github/actions/security/zizmor/action.yaml actions
  • actions/upload-artifact v4 composite
  • astral-sh/setup-uv 6b9c6063abd6010835644d4c2e1bef4cf5cd0fca composite
  • github/codeql-action/upload-sarif 1b549b9259bda1cb5ddde3b41741a82a2d15a841 composite
  • tj-actions/changed-files 823fcebdb31bb35fdf2229d9f769b400309430d0 composite
.github/workflows/_reusable-artifact-builder.yaml actions
  • actions/cache v4 composite
  • actions/checkout v4 composite
  • actions/setup-python v5 composite
  • actions/upload-artifact v4 composite
.github/workflows/_reusable-code-quality.yaml actions
  • ./.github/actions/code-quality/pre-commit * composite
  • actions/checkout v4 composite
.github/workflows/_reusable-production-release-process.yaml actions
  • actions/download-artifact v4 composite
  • actions/upload-artifact v4 composite
.github/workflows/_reusable-rc-release-process.yaml actions
  • actions/download-artifact v4 composite
  • actions/upload-artifact v4 composite
.github/workflows/_reusable-release-publisher.yaml actions
  • actions/download-artifact v4 composite
  • softprops/action-gh-release da05d552573ad5aba039eaac05058a918a7bf631 composite
.github/workflows/_reusable-release-status.yaml actions
.github/workflows/_reusable-release-validation.yaml actions
.github/workflows/_reusable-security-scan.yaml actions
  • ./.github/actions/security/bandit * composite
  • ./.github/actions/security/clamav * composite
  • ./.github/actions/security/semgrep * composite
  • ./.github/actions/security/trivy * composite
  • ./.github/actions/security/zizmor * composite
  • actions/checkout v4 composite
  • actions/download-artifact v4 composite
  • actions/upload-artifact v4 composite
.github/workflows/_reusable-test-suite.yaml actions
  • ./.github/actions/pytest * composite
  • actions/checkout v4 composite
.github/workflows/_reusable-version-check.yaml actions
  • actions/checkout v4 composite
.github/workflows/dco_merge_group.yml actions
.github/workflows/pr.yaml actions
.github/workflows/pre_merge.yml actions
  • AlexanderDokuchaev/md-dead-link-check d5a37e0b14e5918605d22b34562532762ccb2e47 composite
  • actions/checkout v4 composite
  • actions/setup-python v5 composite
.github/workflows/release.yaml actions
.github/workflows/security-checks.yaml actions
pyproject.toml pypi
  • docstring_parser *
  • jsonargparse [signatures]>=4.27.7
  • lightning-utilities *
  • omegaconf >=2.1.1
  • rich >=13.5.2
  • rich_argparse *
requirements.txt pypi