Skip to main content

VAAS (Vision-Attention Anomaly Scoring) is a dual-module vision framework for image anomaly detection and localisation.

Project description

VAAS — Vision-Attention Anomaly Scoring

VAAS (Vision-Attention Anomaly Scoring) is an inference-focused Python library for image anomaly detection and localisation.

It combines global attention-based reasoning with patch-level consistency analysis to produce a continuous anomaly score alongside dense anomaly maps. The output is designed to be interpretable, spatially grounded, and suitable for research and prototyping workflows.

This package provides the runtime inference pipeline only. Pretrained model weights and research assets are hosted separately.


Installation

Install the VAAS inference library from PyPI:

pip install vaas

Optional dependency: PyTorch

VAAS uses lazy loading for PyTorch.

  • Importing vaas does not require PyTorch
  • PyTorch is required only when running inference

If PyTorch is not installed, VAAS will raise a clear runtime error when inference is invoked.

To install PyTorch (CPU, CUDA, or ROCm), follow the official guide: https://pytorch.org/get-started/locally/


Quick Start

from vaas.inference.pipeline import VAASPipeline
from PIL import Image

pipeline = VAASPipeline.from_pretrained(
    "OBA-Research/vaas-v1-df2023",
    device="cpu",
    alpha=0.5,
)

image = Image.open("image.jpg").convert("RGB")
result = pipeline(image)

print(result["S_H"])

Output format

{
    "S_F": float,
    "S_P": float,
    "S_H": float,
    "anomaly_map": numpy.ndarray  # shape (224, 224)
}

Visualisation

VAAS can optionally generate qualitative visual explanations combining:

  • Patch-level anomaly heatmaps
  • Global attention overlays
  • A hybrid anomaly score gauge
pipeline.visualize(
    image="image.jpg",
    save_path="vaas_visualization.png",
    mode="all",
    threshold=0.5,
)

Model Variants

This release supports pretrained models hosted on Hugging Face.

Example:

  • VAAS v1 — trained on 10% of DF2023

Additional variants and future releases may extend training scale and evaluation coverage.


Intended Use

VAAS is intended for:

  • Image anomaly detection
  • Visual integrity assessment
  • Explainable inspection of irregular regions
  • Research on attention-based anomaly scoring
  • Prototyping anomaly-aware vision systems

The library supports CPU-only inference and GPU acceleration when available.


Limitations

  • Trained on a subset of a single dataset
  • Does not classify anomaly types
  • Performance may degrade on out-of-distribution imagery

VAAS should not be used as a standalone decision-making system in high-stakes applications.


License

MIT License


Maintainers

OBA-Research

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

vaas-0.1.7.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

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

vaas-0.1.7-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file vaas-0.1.7.tar.gz.

File metadata

  • Download URL: vaas-0.1.7.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for vaas-0.1.7.tar.gz
Algorithm Hash digest
SHA256 0503ea1a35a75778a71582d99fa4200b0d5d49d47129094a527bc28cdaa29b7a
MD5 441f696cb92d21f0a85abb0075622612
BLAKE2b-256 512865c4ecb9f70f7d3311c1e92f5c6bdebc23c9462db47d3d2b6b606000920b

See more details on using hashes here.

File details

Details for the file vaas-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: vaas-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 12.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for vaas-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 9ade3510450ea40d2192fc8a2bba75f6465916d7a51276663fbf5d39f292cb70
MD5 ce6894ad32f2f06c89b9ac49b4196b19
BLAKE2b-256 2e136026e0e918094148111679f65fd49e9dd1005f0880328232fe81bacfb15b

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