Skip to main content



Sinapsis Anomalib

Module to provide anomaly detection training, inference and export with Anomalib.

🐍 Installation • 🚀 Features • 📚 Usage Example • 📙 Documentation • 🔍 License

🐍 Installation

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

🚀 Features

Templates Supported

The Sinapsis Anomalib provides a powerful and flexible implementation for anomaly detection with Anomalib library.

  • 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.

For example, for CflowTrain use sinapsis info --example-template-config CflowTrain to produce the following example config:

agent:
  name: my_test_agent
templates:
- template_name: InputTemplate
  class_name: InputTemplate
  attributes: {}
- template_name: CflowTrain
  class_name: CflowTrain
  template_input: InputTemplate
  attributes:
    folder_attributes:
      name: 'dataset'
      root: null
      normal_dir: 'images/normal'
      abnormal_dir: null
      normal_test_dir: null
      mask_dir: null
      normal_split_ratio: 0.2
      extensions: null
      train_batch_size: 32
      eval_batch_size: 32
      num_workers: 8
      test_split_mode:
      - from_dir
      test_split_ratio: 0.2
      val_split_mode:
      - from_test
      val_split_ratio: 0.5
      seed: null
    callbacks: null
    normalization: null
    threshold: null
    image_metrics: null
    pixel_metrics: null
    logger: null
    callback_configs: null
    logger_configs: null
    ckpt_path: null
    train_root: null
    trainer_args:
      devices: auto
      accelerator: cpu
      min_epochs: 1
      max_epochs: 5
    cflow_init:
      backbone: wide_resnet50_2
      layers:
      - layer2
      - layer3
      - layer4
      pre_trained: true
      fiber_batch_size: 64
      decoder: freia-cflow
      condition_vector: 128
      coupling_blocks: 8
      clamp_alpha: 1.9
      permute_soft: false
      lr: 0.0001
      pre_processor: true
      post_processor: true
      evaluator: true
      visualizer: true
🚫 Excluded Models

Some models that required additional configuration have been excluded and support for this will be included in future releases.

  • EfficientAd
  • VlmAd
  • Cfa
  • Dfkde
  • Fastflow
  • Supersimplenet
  • AiVad

For all other supported models, refer to the Anomalib documentation linked above.

📚 Usage Example

Below is an example configuration for **Sinapsis Anomalib** using a CFLOW model. This setup trains an anomaly detection model with configurable hyperparameters, including learning rate and epochs, and exports it in OpenVINO format for optimized inference. The pipeline includes training, model export, and predefined paths for outputs.
Example config
agent:
  name: anomalib_train_export

templates:
- template_name: InputTemplate
  class_name: InputTemplate
  attributes: {}

- template_name: CflowTrain
  class_name: CflowTrain
  attributes:
    folder_attributes_config_path: "configs/datamodule_config.yml"
    train_root: "model"
    max_epochs: 1
    cflow_init:
      lr: 0.0001

- template_name: CflowExport
  class_name: CflowExport
  attributes:
    generic_key_chkpt: "CflowTrain"
    export_type: "openvino"
    export_root: "results/model/exported"

This configuration defines an agent and a sequence of templates to train and export a model based on a certain data configuration.

To run the config, use the CLI:

sinapsis run name_of_config.yml

📙 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-anomalib 0.1.14

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sinapsis-anomalib 0.1.14
File Size Uploaded
sinapsis_anomalib-0.1.14.tar.gz 30.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sinapsis-anomalib 0.1.14
File Interpreter ABI Platform
sinapsis_anomalib-0.1.14-py3-none-any.whl Python 3 none any Details

Total release size: 65.0 kB

Release files / sinapsis_anomalib-0.1.14.tar.gz

Download URL sinapsis_anomalib-0.1.14.tar.gz
Size 30.6 kB
Tags Source
SHA-256 checksum
How to use checksums
dc4fa98f75a9062949bf65f48572db884c240dc1e9db99b023d282831d2b5ee8
BLAKE2b-256 checksum
How to use checksums
69278077de9affbe5cd166b25929646597c92d9716908c4dc3b4278bc58e3b37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.17

Release files / sinapsis_anomalib-0.1.14-py3-none-any.whl

Download URL sinapsis_anomalib-0.1.14-py3-none-any.whl
Size 34.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d63baa38c06788f52262ea0166e8af11593b03b02d2b9b75e8109dc41cca27e0
BLAKE2b-256 checksum
How to use checksums
9513bcfd129bed53fce9eb522dccc6cf2da816ef8f3e8fa95074f0a74548194c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.17

Release history Release notifications | RSS feed

This release

0.1.14 This release

2 release files

0.1.12

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page