Skip to content

DeepKnowledge1/AnomaVision

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

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!