A high-level inference SDK for Vectra Engine few-shot models.
Project description
Vectra SDK
A high-level Python library for efficient and user-friendly inference using few-shot models generated by the Vectra Engine.
Features
- Multi-Format Input: Seamlessly predict using file paths, PIL images, or NumPy arrays (OpenCV frames).
- Batch Inference: Process multiple images in a single call.
- Live Stream Support: Simple wrapper for real-time camera inference with visual overlays.
- Unknown Category Rejection: Natively supports out-of-distribution detection.
- Confidence Scores: Returns similarity-based confidence for every prediction.
- Optimized: Automatic GPU acceleration where available.
Installation
Install via pip:
pip install vectra-sdk
Quick Start
1. Basic Inference
from vectra.inference import VectraInference
# Initialize with your trained .pt model
sdk = VectraInference("my_model.pt")
# Predict using a file path
result = sdk.predict("image.jpg")
print(f"Prediction: {result['label']} (Confidence: {result['confidence']:.2f})")
# Predict using a PIL Image
from PIL import Image
img = Image.open("photo.png")
result = sdk.predict(img)
2. Live Camera Feed
from vectra.inference import VectraInference
from vectra.utils.vision import LiveStreamInference
sdk = VectraInference("my_model.pt")
live = LiveStreamInference(sdk)
# Start real-time inference on default camera (index 0)
live.start(camera_index=0)
3. Batch Processing
results = sdk.predict_batch(["img1.jpg", "img2.png", "img3.jpg"])
for res in results:
print(res['label'])
Requirements
- Python 3.8+
- PyTorch & Torchvision
- OpenCV
- Pillow
- NumPy
License
This project is licensed under a Custom Research and Educational Use License. Commercial use is prohibited without prior permission.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vectra_sdk-0.1.0.tar.gz.
File metadata
- Download URL: vectra_sdk-0.1.0.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad8c7a922c32f535346adeb911b3a0f4393e905923174e644420ffa70354664f
|
|
| MD5 |
197f2f34fb9492cc27c13b09decda80a
|
|
| BLAKE2b-256 |
3880f6ac5501cba85525bd78d4b5778cf365fcbb4796e31ff6c7ed0428d0154b
|
File details
Details for the file vectra_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: vectra_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a6fa40884553b18e8628b5c54db4ea0a32061eb0cc573b9c65554e71a928ea3
|
|
| MD5 |
b7385b05a953c429e7946707d89b50f5
|
|
| BLAKE2b-256 |
3476201f96dc410f6faa2331fc609c6dce550463d4bacd2dc2703290aea1fbaa
|