Metadata-Version: 2.4
Name: vectra-sdk
Version: 0.1.0
Summary: A high-level inference SDK for Vectra Engine few-shot models.
Author: Rohit Gomes
Author-email: gomesrohit92@gmail.com
Classifier: Programming Language :: Python :: 3
Classifier: License :: Other/Proprietary License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: torch>=1.10.0
Requires-Dist: torchvision>=0.11.0
Requires-Dist: Pillow
Requires-Dist: numpy
Requires-Dist: opencv-python
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: license-file
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# 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:

```bash
pip install vectra-sdk
```

## Quick Start

### 1. Basic Inference
```python
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
```python
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
```python
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.
