Sinapsis Anomaly Detection
Monorepo with packages to provide anomaly detection training, inference and export for computer vision.
🐍 Installation • 📦 Packages • 🌐 Webapp • 📙 Documentation • 🔍 License
🐍 Installation
This monorepo currently consists of the following packages for anomaly detection:
sinapsis-anomalib
Install using your package manager of choice. We encourage the use of uv
Example with uv:
uv pip install sinapsis-anomalib --extra-index-url https://pypi.sinapsis.tech
or with raw pip:
pip install sinapsis-anomalib --extra-index-url https://pypi.sinapsis.tech
with uv:
uv pip install sinapsis-anomalib[all] --extra-index-url https://pypi.sinapsis.tech
or with raw pip:
pip install sinapsis-anomalib[all] --extra-index-url https://pypi.sinapsis.tech
uv pip install sinapsis-anomaly-detection[all] --extra-index-url https://pypi.sinapsis.tech
📦 Packages
Packages summary
- Sinapsis Anomalib
- AnomalibTorchInference
Run anomaly detection inference using PyTorch models. - AnomalibOpenVINOInference
Perform optimized inference using OpenVINO-accelerated models. - AnomalibTrain
Train custom anomaly detection models with Anomalib. - AnomalibExport
Export trained models for deployment in different formats.
- AnomalibTorchInference
For example, for AnomalibTorchInference use sinapsis info --example-template-config AnomalibTorchInference to produce the following example config:
agent:
name: my_test_agent
templates:
- template_name: InputTemplate
class_name: InputTemplate
attributes: {}
- template_name: AnomalibTorchInference
class_name: AnomalibTorchInference
template_input: InputTemplate
attributes:
model_path: '/path/to/model.pt'
transforms: null
device: cuda
🌐 Webapp
The webapp offers an interface for anomaly detection on images using pretrained models. Upload images and visualize results (labels, bboxes, or masks) based on the provided agent configuration.
git clone git@github.com:Sinapsis-ai/sinapsis-anomaly-detection.git
cd sinapsis-anomaly-detection
🐳 Docker
IMPORTANT This docker image depends on the sinapsis-nvidia:base image. Please refer to the official sinapsis instructions to Build with Docker.
- Build the sinapsis-anomalib image:
docker compose -f docker/compose.yaml build
- Start the app container:
docker compose -f docker/compose_apps.yaml up sinapsis-anomalib-gradio -d
- Check the status:
docker logs -f sinapsis-anomalib-gradio
- The logs will display the URL to access the webapp, e.g.:
NOTE: The url can be different, check the output of the logs
Running on local URL: http://127.0.0.1:7860
- To stop the app:
docker compose -f docker/compose_apps.yaml down
Webapp Configuration
Customize the webapp behavior by updating the environment fields in docker/compose_apps.yaml:
For custom inference agent:
AGENT_CONFIG_PATH: "/app/configs/inference/custom_torch_demo_agent.yml"
For custom training agent:
TRAINING_CONFIG: "/app/configs/custom_train_export_agent.yaml"
For custom inference model path:
MODEL_PATH: "/app/artifacts/exported_models/weights/torch/custom_model.pt"
For custom test data:
TEST_DIR: "/app/artifacts/data/custom_test_data"
💻 UV
To run the webapp using the uv package manager, please:
- Create the virtual environment and sync the dependencies:
uv sync --frozen
- Install the wheel:
uv pip install sinapsis-anomaly-detection[all] --extra-index-url https://pypi.sinapsis.tech
- Run the webapp:
uv run webapps/anomalib_gradio_app.py
- The terminal will display the URL to access the webapp, e.g.:
NOTE: The url can be different, check the output of the terminal
Running on local URL: http://127.0.0.1:7860
Webapp Configuration
Customize the webapp behavior by exporting the following variables with your custom values before running the app:
For custom inference agent:
export AGENT_CONFIG_PATH="packages/sinapsis_anomalib/src/sinapsis_anomalib/configs/inference/custom_torch_demo_agent.yml"
For custom training agent:
export TRAINING_CONFIG="packages/sinapsis_anomalib/src/sinapsis_anomalib/configs/custom_train_export_agent.yaml"
For custom inference model path:
export MODEL_PATH="artifacts/exported_models/weights/torch/custom_model.pt"
For custom test data:
export TEST_DIR="artifacts/data/custom_test_data"
📙 Documentation
Documentation for this and other sinapsis packages is available on the sinapsis website
Tutorials for different projects within sinapsis are available at sinapsis tutorials page
🔍 License
This project is licensed under the AGPLv3 license, which encourages open collaboration and sharing. For more details, please refer to the LICENSE file.
For commercial use, please refer to our official Sinapsis website for information on obtaining a commercial license.
Metadata
Release files for sinapsis-anomaly-detection 0.1.14
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sinapsis_anomaly_detection-0.1.14.tar.gz | 30.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sinapsis_anomaly_detection-0.1.14-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 65.4 kB
Release files / sinapsis_anomaly_detection-0.1.14.tar.gz
| Download URL | sinapsis_anomaly_detection-0.1.14.tar.gz |
|---|---|
| Size | 30.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f607422bd336e8cecc4ed58de33e90414dc535bfb1222c4a12792ca842c54fb3
|
|
BLAKE2b-256 checksum How to use checksums |
b5c02d7dcbc3d6694b41aec8179f1018757836ac6d5d1baabeaf5c03f87b9972
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.17
|
Release files / sinapsis_anomaly_detection-0.1.14-py3-none-any.whl
| Download URL | sinapsis_anomaly_detection-0.1.14-py3-none-any.whl |
|---|---|
| Size | 34.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
395c6578b4be295d1f0a2582cf7c093958b89c570c80c24d441c6ecf58a4bdd3
|
|
BLAKE2b-256 checksum How to use checksums |
198520e29440f63cc26cbb9cd8b5b12bbb89514218ba666e69f1e5b5830c6894
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.17
|