Skip to main content

Build Status Python Package Package Downloads License: MIT

Abraia Vision SDK

The Abraia Vision SDK is a high-performance, edge-ready Python library and toolkit for computer vision, image processing, model training, and advanced inference. It unifies state-of-the-art vision models (such as YOLO, SAM, CLIP, and custom recognition pipelines) into a seamless API for production-ready applications, real-time video analysis, object tracking, hyperspectral imaging, and edge hardware deployment.


📚 Table of Contents


📦 Installation

Install the Abraia SDK from PyPI:

pip install -U abraia

For training and development run the installation with optional extras (dev, multiple):

pip install -U abraia[dev,multiple]

🚀 Core Modules & Features

1. Inference & Computer Vision (abraia.inference)

  • Object Detection: Fast ONNX/YOLO-based object detection (abraia.inference.Model).
  • Segmentation (SAM): Segment Anything Model integration for precise image masking (abraia.inference.Sam).
  • Object Tracking & People Flow: Advanced multi-object tracking (Tracker), line crossing counters (LineCounter), and region duration timers (RegionTimer).
  • Face Recognition: Identify and match faces in images and streams (FaceRecognizer).
  • License Plate Recognition (ALPR): Automatic license plate detection and text recognition (PlateRecognizer).
  • OCR: Extract text from images (Ocr).
  • Semantic Search (CLIP): Vector embeddings and similarity search for text-to-image and image-to-image retrieval (Clip).

2. Image Editing & Enhancement (abraia.editing)

  • Upscaling: Super-resolution image enhancement (upscale).
  • Smart Cropping: Intelligent content-aware cropping (smartcrop).
  • Background Removal: Foreground segmentation and background removal (removebg).
  • Inpainting: Image restoration and object removal (inpaint).

3. Multispectral & Hyperspectral Imaging (abraia.multiple)

  • Specialized tools for hyperspectral and multispectral image analysis, cube processing, and spectral signature extraction (abraia.multiple.hsi).

4. Edge AI & Hardware Acceleration (abraia.hailo)

  • Optimized runtime support and toolboxes for Hailo NPU hardware acceleration (abraia.hailo).

5. Training & Dataset Operations (abraia.training)

  • Tools for training custom classification (classify) and detection (detect) models, along with dataset preprocessing utilities (dataset, ops).

6. Utilities & Video Processing (abraia.utils)

  • Robust video frame iteration and manipulation (Video).
  • Annotation and rendering tools (render_results, render_counter, render_region).
  • Compression and sketch generation utilities.

💡 Examples & Usage Guides

People Monitoring & Tracking

Monitor people flow, count crossings, and track dwell times in public spaces or commercial areas:

from abraia.inference import Model, Tracker
from abraia.inference.tools import LineCounter, RegionTimer
from abraia.utils import Video, render_results, render_counter, render_region

model = Model("multiple/models/yolov8n.onnx")
video = Video('people-walking.mp4')
tracker = Tracker(frame_rate=video.frame_rate)
line_counter = LineCounter([(0, 650), (1920, 650)])
region_timer = RegionTimer([(10, 600), (1690, 600), (1690, 700), (10, 700)])

for k, frame in enumerate(video):
    results = model.run(frame, labels=['person'])
    results = tracker.update(results)
    in_count, out_count = line_counter.update(results)
    in_objects, out_objects = region_timer.update(results, k / video.frame_rate)
    frame = render_counter(frame, line_counter.line, f"In: {in_count} | Out: {out_count}")
    frame = render_region(frame, region_timer.region, f"Count: {len(in_objects)}")
    frame = render_results(frame, in_objects)
    video.show(frame)

people detected

Face Recognition

Identify and recognize people in images:

import os

from abraia.inference import FaceRecognizer
from abraia.utils import load_image, save_image, render_results

img = load_image('images/rolling-stones.jpg')
out = img.copy()

recognition = FaceRecognizer()

index = []
for src in ['mick-jagger.jpg', 'keith-richards.jpg', 'ronnie-wood.jpg', 'charlie-watts.jpg']:
    img = load_image(f"images/{src}")
    rslt = recognition.identify_faces(img)[0]
    index.append({'name': os.path.splitext(src)[0], 'vector': rslt['vector']})

results = recognition.identify_faces(results, index)
render_results(out, results)
save_image(out, 'images/rolling-stones-identified.jpg')

rolling stones identified

License Plate Recognition (ALPR)

Automatically detect and recognize car license plates in images and video streams:

from abraia.inference import PlateRecognizer
from abraia.utils import load_image, show_image, render_results

alpr = PlateRecognizer()

img = load_image('images/car.jpg')
results = alpr.recognize(img)
frame = render_results(img, results)
show_image(img)

car license plate recognition

Semantic Search with CLIP

Search images using natural language text queries via CLIP embeddings:

from tqdm import tqdm
from glob import glob
from abraia.utils import load_image
from abraia.inference.clip import Clip
from abraia.inference.ops import search_vector

clip_model = Clip()

image_paths = glob('images/*.jpg')
image_index = [{'vector': clip_model.get_image_embeddings([load_image(image_path)])[0]} for image_path in tqdm(image_paths)]

text_query = "full body person"
vector = clip_model.get_text_embeddings([text_query])[0]

idxs, scores = search_vector(vector, image_index)
print(f"Similarity score is {scores[0]} for image {image_paths[idxs[0]]}")

🍓 Real-Time Edge Object Counter on Raspberry Pi with Hailo NPU

Deploy high-performance real-time object detection and counting on a Raspberry Pi equipped with a Hailo AI expansion board (such as Hailo-8 or Hailo-8L). This pipeline combines hardware-accelerated model inference (abraia.hailo), multi-object tracking (abraia.inference.Tracker), line crossing counters (LineCounter), and region timers (RegionTimer), integrated with the asynchronous video processing pipeline (VideoInput & VideoDisplay).

Implementation Guide

Create a script (e.g., edge_counter.py) ready for deployment on your Raspberry Pi:

import threading
from abraia.hailo.toolbox import ModelInference
from abraia.inference import Tracker
from abraia.inference.tools import LineCounter, RegionTimer
from abraia.utils import VideoInput, VideoDisplay, render_results, render_counter, render_region
from abraia.hailo.detect import run_inference_pipeline

# 1. Initialize threaded video input (e.g., Raspberry Pi Camera or RTSP stream)
stop_event = threading.Event()
input_data = VideoInput(input_src=0, resolution=(1920, 1080), stop_event=stop_event)
visualizer = VideoDisplay(source_fps=input_data.source_fps, stop_event=stop_event)

# 2. Load Hailo compiled model (.hef) optimized for edge NPU
model_inference = ModelInference(
    hef_path="yolov8n.hef",
    task="detect",
    labels=["person", "car"],
    batch_size=1,
    score_threshold=0.3
)

# 3. Setup Tracker & Analytics Tools (Line Counter & Region Timer)
tracker = Tracker(frame_rate=input_data.source_fps or 30.0)
line_counter = LineCounter([(100, 540), (1820, 540)])     # Crossing boundary line
region_timer = RegionTimer([(300, 200), (1620, 200), (1620, 900), (300, 900)]) # Zone of interest

# 4. Custom Inference & Analytics Result Handler
def edge_processing_handler(frame, detections, tracker=None, tracklet_history=None):
    if tracker:
        detections = tracker.update(detections)

    # Update line crossing and region analytics
    in_count, out_count = line_counter.update(detections)
    in_objects, out_objects = region_timer.update(detections, 1.0 / (input_data.source_fps or 30.0))

    # Render real-time visual overlays
    frame = render_counter(frame, line_counter.line, f"In: {in_count} | Out: {out_count}")
    frame = render_region(frame, region_timer.region, f"Zone Count: {len(in_objects)}")
    return render_results(frame, detections)

# 5. Run High-Performance Edge Pipeline
try:
    run_inference_pipeline(
        model_inference=model_inference,
        input_data=input_data,
        visualizer=visualizer,
        tracker=tracker
    )
finally:
    stop_event.set()

Deployment on Raspberry Pi

Execute the script directly on the Raspberry Pi:

python3 edge_counter.py

📄 License

This project is licensed under the MIT License.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

abraia-0.27.3.tar.gz (88.0 kB view details)

Uploaded Source

Built Distribution

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

abraia-0.27.3-py3-none-any.whl (1.5 MB view details)

Uploaded Python 3

File details

Details for the file abraia-0.27.3.tar.gz.

File metadata

  • Download URL: abraia-0.27.3.tar.gz
  • Upload date:
  • Size: 88.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for abraia-0.27.3.tar.gz
Algorithm Hash digest
SHA256 9ef5b2c97b143efd014ef4d7a4422a3e5e20a0bb97cf4ccfda09066dbfaecfc8
MD5 c4a16dcaf8d95dce6a663ce8cbccb218
BLAKE2b-256 bcf6021df363b9c41e364e824d7afe30463aa12d0399ab290c1e8d08d36117b0

See more details on using hashes here.

File details

Details for the file abraia-0.27.3-py3-none-any.whl.

File metadata

  • Download URL: abraia-0.27.3-py3-none-any.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for abraia-0.27.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f0372bb5cd2fd305107dd826efe408c37aed0f05fc6da86ac13663e41f3532c0
MD5 9875a2026d60a94443d340987e9091c2
BLAKE2b-256 8e97d243179057796b6de838328362908f3c7acc56a869d76a0b2f6739fa5240

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.27.3 This release

2 files

0.27.2

2 files

0.27.1

2 files

0.27.0

2 files

0.26.1

2 files

0.26.0

2 files

0.25.15

2 files

0.25.14

2 files

0.25.13

2 files

0.25.12

2 files

0.25.11

2 files

0.25.10

2 files

0.25.9

2 files

0.25.8

2 files

0.25.7

2 files

0.25.6

2 files

0.25.5

2 files

0.25.4

2 files

0.25.3

2 files

0.25.2

2 files

0.25.1

2 files

0.25.0

2 files

0.24.2

2 files

0.24.1

2 files

0.24.0

2 files

0.23.8

2 files

0.23.7

2 files

0.23.6

2 files

0.23.5

2 files

0.23.4

2 files

0.23.3

2 files

0.23.2

2 files

0.23.1

2 files

0.23.0

2 files

0.22.0

2 files

0.21.1

2 files

0.21.0

2 files

0.20.4

2 files

0.20.3

2 files

0.20.2

2 files

0.20.1

2 files

0.20.0

2 files

0.19.1

2 files

0.19.0

2 files

0.18.0

2 files

0.17.7

2 files

0.17.6

2 files

0.17.5

2 files

0.17.4

2 files

0.17.3

2 files

0.17.2

2 files

0.17.1

2 files

0.17.0

2 files

0.16.0

2 files

0.15.4

2 files

0.15.3

2 files

0.15.2

2 files

0.15.1

2 files

0.15.0

2 files

0.14.0

2 files

0.13.3

2 files

0.13.2

2 files

0.13.1

2 files

0.13.0

2 files

0.12.4

2 files

0.12.3

2 files

0.12.2

2 files

0.12.1

2 files

0.12.0

2 files

0.11.7

2 files

0.11.6

2 files

0.11.5

2 files

0.11.4

2 files

0.11.3

2 files

0.11.2

2 files

0.11.1

2 files

0.11.0

2 files

0.10.7

2 files

0.10.6

2 files

0.10.5

2 files

0.10.4

2 files

0.10.3

2 files

0.10.2

2 files

0.10.1

2 files

0.10.0

2 files

0.9.4

2 files

0.9.3

2 files

0.9.2

2 files

0.9.1

2 files

0.9.0

2 files

0.8.10

2 files

0.8.9

2 files

0.8.8

2 files

0.8.7

2 files

0.8.6

2 files

0.8.5

2 files

0.8.4

2 files

0.8.3

2 files

0.8.2

2 files

0.8.1

2 files

0.8.0

2 files

0.7.2

2 files

0.7.1

2 files

0.7.0

2 files

0.6.6

2 files

0.6.5

2 files

0.6.4

2 files

0.6.3

2 files

0.6.2

2 files

0.6.1

2 files

0.6

2 files

0.5.0

2 files

0.4.8

2 files

0.4.7

2 files

0.4.6

2 files

0.4.5

2 files

0.4.4

2 files

0.4.3

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.5

2 files

0.3.4

2 files

0.3.3

2 files

0.3.0

2 files

0.2.13

2 files

0.2.12

2 files

0.2.11

2 files

0.2.10

3 files

0.2.9

3 files

0.2.8

3 files

0.2.7

3 files

0.2.6

3 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.5

1 file

0.1.4

1 file

0.1.3

1 file

0.1.2

2 files

0.1

2 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