Skip to main content

Averian AI Validator SDK

Project description

Averian AI Validator SDK

Python SDK for the Averian AI Validator platform. Integrate anomaly detection inference into your application in minutes.

Installation

pip install averian-ai-validator-sdk

Prerequisites

  • An API key with inference access — obtained from the Organization Settings page by an admin user
  • A project with at least one trained and hosted model ensemble

Quick Start — Inference

This guide assumes your project, input source, and model are already set up in the Averian AI Validator platform.

Step 1 — Connect

from averian_ai_validator_sdk import APIClient

api = APIClient()
api.connect("https://api.yourhost.com", "YOUR_API_KEY")

For servers with a self-signed certificate:

api.connect("https://api.yourhost.com", "YOUR_API_KEY", ca_cert="/path/to/ca.pem")

API keys are created and managed by admin users in the Organization Settings page. Each key has a specific level of access — contact your administrator to obtain a key with inference permissions.

Step 2 — Select Project and Input Source

# List and select a project
projects = api.get_projects()['projects']
project_id = projects[0]['id']  # or match by name

# List and select an input source
sources = api.get_input_sources(project_id)
input_id = sources[0]['id']  # or match by name

Step 3 — Get the Model

The SDK uses the default model ensemble if one has been set for the input source, and falls back to the last active model if not.

source = api.get_input_source_by_id(project_id, input_id)
model_id = source.get('defaultEnsemble')

if not model_id:
    model = api.get_last_active_model(project_id, input_id)
    if not model:
        raise RuntimeError("No hosted model available for this input source.")
    model_id = model['id']

print(f"Using model: {model_id}")

Step 4 — Run Inference

import os

image_path = "part_to_inspect.jpg"
img_name, img_ext = os.path.splitext(os.path.basename(image_path))
img_blob = api.read_file_as_blob(image_path)

result = api.infer(project_id, input_id, model_id, img_name, img_ext.lstrip("."), img_blob)

print(f"Anomalous: {result['isAnomalous']}")
print(f"Result ID: {result['id']}")

Step 5 — Retrieve the Heatmap

heatmap = api.fetch_result_image_with_heatmap(project_id, result['id'])
with open("heatmap.jpg", "wb") as f:
    f.write(heatmap)
print("Heatmap saved to heatmap.jpg")

Step 6 — Clean Up (Optional)

api.del_result(project_id, result['id'])

For the full API reference, visit the Averian AI Validator documentation.

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

averian_ai_validator_sdk-1.0.1188.tar.gz (12.9 kB view details)

Uploaded Source

Built Distribution

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

averian_ai_validator_sdk-1.0.1188-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file averian_ai_validator_sdk-1.0.1188.tar.gz.

File metadata

File hashes

Hashes for averian_ai_validator_sdk-1.0.1188.tar.gz
Algorithm Hash digest
SHA256 b5ddcb7a9e68e9641577136edba813d89aeeb29558b36a4d03dca1aa831d19e8
MD5 f9081abba08b5fe52f16f87ed7b316fa
BLAKE2b-256 3ac7ccf474b7ee2014406bd6aa5764e26c9a386cc6c7dcdb7e5abd38d96f78a7

See more details on using hashes here.

File details

Details for the file averian_ai_validator_sdk-1.0.1188-py3-none-any.whl.

File metadata

File hashes

Hashes for averian_ai_validator_sdk-1.0.1188-py3-none-any.whl
Algorithm Hash digest
SHA256 63a848b4312589782e3962b4328cfdbea872b8e63acb1b93ce043bde5af74b2e
MD5 0b31b2d5e4648109d01e6be653ddfb3d
BLAKE2b-256 11d5233c165295d5ad9a352e6f72ce0d19719a726eeb545ced1e6a0edbf55ce3

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