Skip to main content

EVREN MLOps Platform — Python inference SDK for object detection, classification, and segmentation models.

Project description

EVREN

evren-sdk

PyPI Python License

Türkçe · English


Türkçe

EVREN platformu üzerinde eğitilmiş bilgisayarlı görü modellerine Python'dan çıkarım (inference) yapmanızı sağlayan resmi SDK.

Desteklenen görevler: nesne tespiti, sınıflandırma, segmentasyon, döndürülmüş kutu (OBB), anahtar nokta (keypoint).

pip install evren-sdk

Hızlı Başlangıç

from evren_sdk import EvrenClient

client = EvrenClient(api_key="evren_xxxxx")

result = client.predict("kullanici/model-adi", "foto.jpg", confidence=0.3)

for det in result.predictions:
    print(f"{det.class_name}: {det.confidence:.0%}  bbox={det.bbox}")

print(f"Çıkarım süresi: {result.inference_ms:.0f} ms")

Kimlik Doğrulama

Platformda Ayarlar → API Anahtarları sayfasından anahtar oluşturun. Anahtar evren_ ön eki ile başlar ve X-API-Key başlığı üzerinden otomatik gönderilir.

# API anahtarı ile (önerilen)
client = EvrenClient(api_key="evren_xxxxx")

# JWT token ile de çalışır
client = EvrenClient(api_key="eyJhbGci...")

Tekil Çıkarım

result = client.predict(
    model="kullanici/model-adi",        # slug veya UUID
    image="resim.jpg",                  # dosya yolu, Path veya bytes
    confidence=0.25,
    iou=0.45,
    image_size=640,
    classes=["araba", "insan"],         # isteğe bağlı sınıf filtresi
)

model parametresi üç format kabul eder:

Format Açıklama
"owner/slug" Son versiyonu otomatik çözer
"owner/slug:v2.0" Belirli versiyon etiketi
"019cec..." (UUID) Doğrudan versiyon kimliği

Toplu Çıkarım (Batch)

Birden fazla görseli tek istekte GPU batch çıkarımı ile işleyin.

batch = client.predict_batch(
    model="kullanici/model-adi",
    images=["img1.jpg", "img2.jpg", "img3.jpg"],
    confidence=0.3,
)

for r in batch:
    print(f"{r.count} tespit, {r.inference_ms:.0f} ms")

print(f"Toplam: {batch.total_ms:.0f} ms, {batch.count} görsel")

Model Bilgileri

info = client.model_classes("kullanici/model-adi")
print(info.architecture)
for cls in info.classes:
    print(f"  {cls.name}: {cls.color}")

for m in client.list_models():
    print(f"{m.full_slug}{m.architecture}")

Ön Yükleme (Warmup)

İlk çıkarım gecikmesini ortadan kaldırmak için modelleri önceden GPU'ya yükleyin.

client.warmup(["kullanici/model-adi", "diger/model"])

Asenkron Kullanım

import asyncio
from evren_sdk import AsyncEvrenClient

async def main():
    async with AsyncEvrenClient(api_key="evren_xxxxx") as client:
        result = await client.predict("kullanici/model-adi", "foto.jpg")
        batch = await client.predict_batch(
            "kullanici/model-adi", ["a.jpg", "b.jpg"],
        )

asyncio.run(main())

Hata Yönetimi

from evren_sdk import EvrenClient, NotFoundError, RateLimitError, InferenceError

client = EvrenClient(api_key="evren_xxxxx")

try:
    result = client.predict("kullanici/model", "test.jpg")
except NotFoundError:
    print("Model bulunamadı")
except RateLimitError as e:
    time.sleep(e.retry_after)
except InferenceError:
    print("GPU sunucusu geçici olarak kullanılamıyor")
Exception HTTP Açıklama
AuthenticationError 401, 403 Geçersiz veya süresi dolmuş anahtar
NotFoundError 404 Model veya versiyon bulunamadı
ValidationError 422 Hatalı parametre
RateLimitError 429 İstek limiti aşıldı
InferenceError 502, 503 GPU sunucusu hatası

Edge Modu (GPU'suz Cihazlar)

GPU olmayan cihazlarda (Raspberry Pi, laptop, endüstriyel PC) kamera veya video üzerinden gerçek zamanlı çıkarım yapın. Çıkarım EVREN GPU'larında çalışır, kullanıcı lokal model gibi deneyimler.

pip install evren-sdk[edge]
from evren_sdk import EvrenCamera

cam = EvrenCamera("evren_...", "owner/model")

# Tek satir: webcam ac, ESC ile kapat
cam.run(0)
# Iterator olarak — kendi dongunuzde kullanin
for frame, result in cam.stream(0):
    print(f"{result.count} tespit, {result.inference_ms:.0f}ms")
    # frame zaten annotated (bbox + label cizili)
# Video dosyasi isle + annotated cikti kaydet
cam.record("input.mp4", "output.mp4")
# Klasordeki gorselleri toplu isle
for path, result in cam.scan("images/", save_to="results/"):
    print(f"{path.name}: {result.count} nesne")
# RTSP IP kamera
for frame, result in cam.stream("rtsp://192.168.1.10/stream"):
    ...

Desteklenen kaynaklar: webcam (0, 1), video dosyası (*.mp4, *.avi), RTSP akışı, HTTP stream, görsel klasörü.

Parametre Varsayılan Açıklama
max_fps 15.0 Bant genişliğini korumak için FPS limiti
jpeg_quality 70 JPEG sıkıştırma kalitesi (20-95)
draw True Tahminleri frame üzerine çiz
confidence 0.25 Minimum güven eşiği
# draw_predictions() bagimsiz kullanilabilir
from evren_sdk import draw_predictions

frame = cv2.imread("foto.jpg")
result = client.predict("owner/model", "foto.jpg")
draw_predictions(frame, result.predictions)
cv2.imwrite("annotated.jpg", frame)

English

Official Python SDK for running inference on computer vision models trained on the EVREN platform.

Supported tasks: object detection, classification, segmentation, oriented bounding box (OBB), keypoint detection.

pip install evren-sdk

Quick Start

from evren_sdk import EvrenClient

client = EvrenClient(api_key="evren_xxxxx")

result = client.predict("owner/model-name", "photo.jpg", confidence=0.3)

for det in result.predictions:
    print(f"{det.class_name}: {det.confidence:.0%}  bbox={det.bbox}")

print(f"Inference time: {result.inference_ms:.0f} ms")

Authentication

Create an API key from Settings → API Keys on the platform. Keys start with the evren_ prefix and are sent automatically via the X-API-Key header.

# API key (recommended)
client = EvrenClient(api_key="evren_xxxxx")

# JWT tokens also work
client = EvrenClient(api_key="eyJhbGci...")

Single Prediction

result = client.predict(
    model="owner/model-name",           # slug or UUID
    image="image.jpg",                  # file path, Path, or bytes
    confidence=0.25,
    iou=0.45,
    image_size=640,
    classes=["car", "person"],          # optional class filter
)

The model parameter accepts three formats:

Format Description
"owner/slug" Resolves to latest version automatically
"owner/slug:v2.0" Specific version tag
"019cec..." (UUID) Direct version ID

Batch Prediction

Process multiple images in a single request with GPU batch inference.

batch = client.predict_batch(
    model="owner/model-name",
    images=["img1.jpg", "img2.jpg", "img3.jpg"],
    confidence=0.3,
)

for r in batch:
    print(f"{r.count} detections, {r.inference_ms:.0f} ms")

print(f"Total: {batch.total_ms:.0f} ms, {batch.count} images")

Model Information

info = client.model_classes("owner/model-name")
print(info.architecture)
for cls in info.classes:
    print(f"  {cls.name}: {cls.color}")

for m in client.list_models():
    print(f"{m.full_slug}{m.architecture}")

Warmup

Pre-load models onto the GPU to eliminate cold-start latency.

client.warmup(["owner/model-name", "other/model"])

Async Usage

Same API surface with async/await:

import asyncio
from evren_sdk import AsyncEvrenClient

async def main():
    async with AsyncEvrenClient(api_key="evren_xxxxx") as client:
        result = await client.predict("owner/model-name", "photo.jpg")
        batch = await client.predict_batch(
            "owner/model-name", ["a.jpg", "b.jpg"],
        )

asyncio.run(main())

Error Handling

from evren_sdk import EvrenClient, NotFoundError, RateLimitError, InferenceError

client = EvrenClient(api_key="evren_xxxxx")

try:
    result = client.predict("owner/model", "test.jpg")
except NotFoundError:
    print("Model not found")
except RateLimitError as e:
    time.sleep(e.retry_after)
except InferenceError:
    print("GPU server temporarily unavailable")
Exception HTTP Description
AuthenticationError 401, 403 Invalid or expired key
NotFoundError 404 Model or version not found
ValidationError 422 Invalid parameter
RateLimitError 429 Rate limit exceeded
InferenceError 502, 503 GPU server error

Edge Mode (GPU-free Devices)

Run real-time inference on devices without a GPU (Raspberry Pi, laptops, industrial PCs). Inference runs on EVREN's cloud GPUs — the user experience feels completely local.

pip install evren-sdk[edge]
from evren_sdk import EvrenCamera

cam = EvrenCamera("evren_...", "owner/model")

# One-liner: opens webcam, press ESC to quit
cam.run(0)
# Iterator — use in your own loop
for frame, result in cam.stream(0):
    print(f"{result.count} detections, {result.inference_ms:.0f}ms")
    # frame is already annotated (bboxes + labels drawn)
# Process video file + save annotated output
cam.record("input.mp4", "output.mp4")
# Batch process a folder of images
for path, result in cam.scan("images/", save_to="results/"):
    print(f"{path.name}: {result.count} objects")
# RTSP IP camera
for frame, result in cam.stream("rtsp://192.168.1.10/stream"):
    ...

Supported sources: webcam (0, 1), video files (*.mp4, *.avi), RTSP streams, HTTP streams, image folders.

Parameter Default Description
max_fps 15.0 FPS cap to conserve bandwidth
jpeg_quality 70 JPEG compression quality (20-95)
draw True Render predictions on frame
confidence 0.25 Minimum confidence threshold
# draw_predictions() works standalone
from evren_sdk import draw_predictions

frame = cv2.imread("photo.jpg")
result = client.predict("owner/model", "photo.jpg")
draw_predictions(frame, result.predictions)
cv2.imwrite("annotated.jpg", frame)

Data Models

Class Key Fields
PredictResult predictions, inference_ms, image_width, image_height, count
Prediction class_name, confidence, bbox, color, mask, keypoints, obb
BatchResult results, total_ms, count — iterable
ModelClasses classes, architecture, model_name, imgsz — supports in operator
ModelInfo id, name, slug, architecture, full_slug
ModelVersion id, version_tag, framework, metrics
EvrenCamera stream(), run(), scan(), record(), stats

Requirements

License

Apache License 2.0

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

evren_sdk-0.5.0.tar.gz (19.8 kB view details)

Uploaded Source

Built Distribution

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

evren_sdk-0.5.0-py3-none-any.whl (20.9 kB view details)

Uploaded Python 3

File details

Details for the file evren_sdk-0.5.0.tar.gz.

File metadata

  • Download URL: evren_sdk-0.5.0.tar.gz
  • Upload date:
  • Size: 19.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for evren_sdk-0.5.0.tar.gz
Algorithm Hash digest
SHA256 8ab05dd6657c5368a4b88c301b7321269dd695a8bd59f90966dfe12afbdd7a42
MD5 3e77b965b3a5017d8202bf8efaf157be
BLAKE2b-256 f660caef0ac5a34c97a6be0de3b5c668ebd35eabebe9369fb113bcbe73d1bce8

See more details on using hashes here.

Provenance

The following attestation bundles were made for evren_sdk-0.5.0.tar.gz:

Publisher: publish.yml on speker/evren-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file evren_sdk-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: evren_sdk-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 20.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for evren_sdk-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eb286d4530edcfcfdc39532de8e96784b7a096e8fd697ae5292eb3f120dc6d32
MD5 b490e649ed421fba4e77872f66540e89
BLAKE2b-256 4591b90cd07d36d2718ca25a8badbeed1898c586513567e2eb57ff675b49d98c

See more details on using hashes here.

Provenance

The following attestation bundles were made for evren_sdk-0.5.0-py3-none-any.whl:

Publisher: publish.yml on speker/evren-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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