Skip to main content

Advanced Anomaly Detection Environment - Deep learning library for state-of-the-art anomaly detection algorithms

Project description

AnomaVision banner

AnomaVision: Edge-Ready Visual Anomaly Detection

Python 3.9โ€“3.12 PyTorch 2.0+ ONNX Ready OpenVINO Ready TorchScript TensorRT Quantization

PyPI Version PyPI Downloads License: MIT

Lightweight, fast, and production-ready anomaly detection powered by PaDiM. Deploy anywhere: edge devices, servers, or the cloud.


Overview

AnomaVision delivers state-of-the-art visual anomaly detection optimized for real-world deployment. Built for speed and efficiency, it outperforms existing solutions while maintaining a small footprint perfect for edge devices.

Key Features

  • ๐ŸŽฏ Superior Performance โ€” Higher AUROC across MVTec AD and Visa datasets
  • โšก 3ร— Faster Inference โ€” Optimized for both CPU and GPU deployment
  • ๐Ÿ“ฆ Smaller Models โ€” 30MB models with lower memory footprint
  • ๐ŸŒ Multi-Backend Export โ€” PyTorch, ONNX, TorchScript, OpenVINO, TensorRT, INT8 Quantization
  • ๐Ÿ–ฅ๏ธ Production Ready โ€” Python API, CLI tools, C++ runtime, and REST API
  • ๐ŸŽจ Rich Visualizations โ€” Heatmaps, bounding boxes, and ROC curves
  • ๐ŸŽฎ Interactive Demo โ€” Streamlit web interface for instant testing

Why Choose AnomaVision?

Performance Advantages Over Anomalib

CPU Inference:

Metric AnomaVision Anomalib Improvement
Training Time (s) 8.38 13.07 -35.9%
Inference FPS 43.41 13.03 +233%
ms / image 23.0 76.7 -70%

GPU Inference (CUDA):

Metric AnomaVision Anomalib Improvement
Training Time (s) 8.38 13.07 -35.9%
Inference FPS 547.46 355.72 +53.9%
ms / image 1.83 2.81 -35.0%

Accuracy:

  • MVTec AD: Image AUROC 0.85 vs 0.81 | Pixel AUROC 0.96 vs 0.94
  • Visa: Image AUROC 0.81 vs 0.78 | Pixel AUROC 0.96 vs 0.95

๐Ÿ’ก Download Full Performance Analysis (PDF) | Detailed Benchmarks


Quick Start

Installation

Using Poetry (Recommended):

git clone https://github.com/DeepKnowledge1/AnomaVision.git
cd AnomaVision
poetry install
poetry shell

Using pip:

pip install AnomaVision

๐Ÿ“– Detailed Installation Guide

Basic Usage

Training:

python train.py --config config.yml
# Outputs: padim_model.pt, padim_model.pth, config.yml

Detection:

python detect.py --config config.yml

Evaluation:

python eval.py --config config.yml

Export:

python export.py --config export_config.yml

๐Ÿ“– Complete Quick Start Guide


Interactive Demo

AnomaVision Streamlit Demo

Real-time anomaly detection with explainable heatmaps

Experience AnomaVision through our intuitive web interface:

  • โšก Real-time anomaly detection
  • ๐ŸŽฏ Explainable AI with visual heatmaps
  • ๐Ÿ“Š Interactive threshold controls
  • ๐Ÿ” Batch processing support
  • ๐Ÿ’พ Export results as JSON
  • ๐ŸŽฎ No coding required

Launch the Demo

# Start FastAPI backend
uvicorn apps.api.fastapi_app:app --host 0.0.0.0 --port 8000

# Launch Streamlit demo (new terminal)
streamlit run apps/ui/streamlit_app.py -- --port 8000

Open http://localhost:8501 in your browser.

๐Ÿ“– Streamlit Demo Guide


Deployment Options

Method Best For Key Benefits
๐ŸŽจ Streamlit Demo Testing, demonstrations Zero-code UI, instant feedback
๐Ÿ“Œ FastAPI Backend Production APIs REST endpoints, scalable
๐Ÿ–ฅ๏ธ C++ Runtime Edge devices No Python dependency, ultra-fast
๐Ÿ’ป Python CLI Batch processing Scriptable, configurable
๐Ÿ“ฆ PyPI Package Custom integration Import as library

REST API Example

import requests

with open("test_image.jpg", "rb") as f:
    response = requests.post(
        "http://localhost:8000/predict",
        files={"file": f},
        params={"include_visualizations": True}
    )
    result = response.json()
    print(f"Anomaly Score: {result['anomaly_score']}")
    print(f"Is Anomaly: {result['is_anomaly']}")

๐Ÿ“– FastAPI Setup Guide

C++ Inference

Deploy without Python using our ONNX Runtime + OpenCV implementation:

  • ๐Ÿ–ผ๏ธ Complete pipeline from preprocessing to visualization
  • ๐Ÿ“ฆ Modular architecture
  • ๐ŸŒ Perfect for edge devices

๐Ÿ“– C++ Inference Guide


Use Cases

  • ๐Ÿญ Manufacturing QC โ€” Real-time defect detection on production lines
  • ๐Ÿ”ฌ Medical Imaging โ€” Anomaly identification in X-rays, MRIs, microscopy
  • ๐Ÿ—๏ธ Infrastructure โ€” Crack and corrosion detection
  • ๐Ÿ“ฑ PCB Inspection โ€” Soldering defects and component issues
  • ๐ŸŒพ Agriculture โ€” Plant disease and crop monitoring
  • ๐Ÿš— Automotive โ€” Paint defects and assembly quality

Documentation


Community & Support


Citation

@software{anomavision2025,
  title={AnomaVision: Edge-Ready Visual Anomaly Detection},
  author={DeepKnowledge Contributors},
  year={2025},
  url={https://github.com/DeepKnowledge1/AnomaVision},
}

Acknowledgments

Built on the foundation of Anodet. We thank the original authors for their contributions to open-source anomaly detection research.


License

Released under the MIT License.


Ready to get started? Follow our Quick Start Guide and build your first anomaly detection pipeline in 5 minutes!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

anomavision-3.1.0.tar.gz (52.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

anomavision-3.1.0-py3-none-any.whl (72.9 kB view details)

Uploaded Python 3

File details

Details for the file anomavision-3.1.0.tar.gz.

File metadata

  • Download URL: anomavision-3.1.0.tar.gz
  • Upload date:
  • Size: 52.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.11.0 Windows/10

File hashes

Hashes for anomavision-3.1.0.tar.gz
Algorithm Hash digest
SHA256 f115278e6717955dd967497a08359ba46b32abdd464687df1f1b4b503dad2070
MD5 0afd485b5e82696ea5470941bcc906d4
BLAKE2b-256 27936fd51e0c2e92cfbc14d1d67c341468b79bda02647ff76481a7d0e48a3d6a

See more details on using hashes here.

File details

Details for the file anomavision-3.1.0-py3-none-any.whl.

File metadata

  • Download URL: anomavision-3.1.0-py3-none-any.whl
  • Upload date:
  • Size: 72.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.11.0 Windows/10

File hashes

Hashes for anomavision-3.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 074d557e59b10f55a6709575ccf3bf042401519fdf0770c4bc24616a55d8df79
MD5 fcc7f3d949fad6a15762391160c38be1
BLAKE2b-256 e085fb44b35bad26ba2fcf9eef9921403276a27adc71b01e043d02893824aeec

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page