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.


โœจ Features

  • ๐Ÿ“ฆ Multi-backend exports: PyTorch, ONNX, TorchScript, OpenVINO, TorchRT,INT8 Quantization
  • ๐ŸŽจ Visualizations: anomaly heatmaps, bounding boxes, ROC curves
  • ๐Ÿ–ฅ๏ธ Unified Python + CLI workflows
  • ๐ŸŒ Edge-first design with compact .pth models
  • โšกC++ inference runtime for edge deployment

๐Ÿ†š Why AnomaVision over Anomalib?

  • โšก 3ร— faster inference on CPU (MVTec & Visa benchmarks)
  • ๐Ÿ“ฆ Smaller models (30 MB vs 40 MB) with lower memory usage
  • ๐ŸŽฏ Higher AUROC across most classes on both MVTec AD and Visa datasets
  • ๐ŸŒ Edge-first design โ†’ optimized for ONNX, TorchScript, and OpenVINO
  • ๐Ÿ›ก๏ธ Production-ready with clean API, CLI, and deployment options

โšก Speed Comparison (CPU Mode)

Metric ๐ŸŸข AnomaVision ๐Ÿ”ต Anomalib ๐Ÿ”บ Difference ๐Ÿ† Winner
๐Ÿงฎ Training Time (s) 8.38 13.07 -35.9% ๐ŸŸข AV
๐Ÿš€ Inference FPS 43.41 13.03 +233% ๐ŸŸข AV
โฑ๏ธ ms / image 23.0 76.7 -70% ๐ŸŸข AV

โšก AnomaVision trains faster, infers over 3ร— quicker, and processes each image in 70% less time โ€” making it ideal for real-time CPU deployment.

โšก Speed Comparison (CUDA Mode)

Metric ๐ŸŸข AnomaVision ๐Ÿ”ต Anomalib ๐Ÿ”บ Difference ๐Ÿ† Winner
๐Ÿงฎ Training Time (s) 8.38 13.07 -35.9% ๐ŸŸข AV
๐Ÿš€ Inference FPS 547.46 355.72 +53.9% ๐ŸŸข AV
โฑ๏ธ ms / image 1.83 2.81 -35.0% ๐ŸŸข AV

โšก AnomaVision runs over 1.5ร— faster โ€” ideal for real-time edge inspection.

๐Ÿ‘‰ See detailed results in Benchmarks.

๐Ÿ‘‰ Download: AnomaVision vs Anomalib โ€” A Comprehensive Performance Analysis (PDF)


๐Ÿ–ฅ๏ธ C++ Inference with ONNX

AnomaVision isnโ€™t just Python ๐Ÿš€ โ€” it also provides a C++ implementation for ONNX Runtime + OpenCV.

  • ๐Ÿ–ผ๏ธ Full pipeline: preprocessing โ†’ inference โ†’ postprocessing โ†’ visualization
  • ๐Ÿ“ฆ Modular design (Config, Preprocessor, ONNXModel, Postprocessor, Visualizer, App)
  • ๐ŸŒ Perfect for edge devices and production environments without Python

๐Ÿ‘‰ See full guide: Quickstart โ€” C++ Inference


๐Ÿ“š Documentation

๐Ÿ“– Full docs are available in the /docs folder.


Installation

Quick Install: using Pyenv and Poetry

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

From PYPI: PYPI Video

pip install AnomaVision

โžก For detailed installation options, see Installation Guide.

โšก Quick Example

Train with a config file:

python train.py --config config.yml

## Save:
# Full model โ†’ padim_model.pt
# Compact stats-only model โ†’ padim_model.pth
# Config snapshot โ†’ config.yml

Run detection:

python detect.py --config config.yml

Evaluate performance:

python eval.py --config config.yml

Export to ONNX:

python export.py --config export_config.yml

โžก For more examples, see Quick Start.


๐Ÿ“Š Benchmarks (Summary)

MVTec AD (15 classes)

  • Image AUROC: AV 0.85 โ†‘ vs AL 0.81
  • Pixel AUROC: AV 0.96 โ†‘ vs AL 0.94
  • FPS: AV 43 โ†‘ vs AL 13

Visa (12 classes)

  • Image AUROC: AV 0.81 โ†‘ vs AL 0.78
  • Pixel AUROC: AV 0.96 โ†‘ vs AL 0.95
  • FPS: AV 45 โ†‘ vs AL 13

๐Ÿ“Š Full tables & plots โ†’ Benchmarks


๐Ÿค Contributing

We welcome contributions!


๐Ÿ™ Acknowledgments

AnomaVision is built on top of the excellent Anodet repository. We thank the original authors for their contributions to open-source anomaly detection research, which laid the foundation for this work.


๐Ÿ“œ Citation

If you use AnomaVision in your research, please cite:

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

๐Ÿ’ฌ Community & Support


๐Ÿ‘‰ Start with Quick Start and build your first anomaly detection pipeline in 5 minutes!

About

Optimized PaDim based on Anodet

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •