"""Toplu cikarim — birden fazla gorseli tek GPU batch isteginde isle.

Kullanim:
    python 02_batch_inference.py images/*.jpg
"""

import sys
from pathlib import Path

from evren_sdk import EvrenClient

client = EvrenClient(api_key="evren_xxxxx")

images = sys.argv[1:] or ["img1.jpg", "img2.jpg", "img3.jpg"]

batch = client.predict_batch(
    model="kullanici/smoke-detection",
    images=images,
    confidence=0.25,
    iou=0.45,
)

for i, r in enumerate(batch):
    src = Path(images[i]).name if i < len(images) else f"#{i}"
    print(f"  {src}: {r.count} nesne, {r.inference_ms:.0f} ms")

print(f"\nToplam: {batch.count} gorsel, {batch.total_ms:.0f} ms")
