"""Temel tekil cikarim ornegi.

Kullanim:
    pip install evren-sdk
    python 01_quickstart.py
"""

from evren_sdk import EvrenClient

API_KEY = "evren_xxxxx"  # kendi anahtarinizi yazin

client = EvrenClient(api_key=API_KEY)

# --- slug ile cikarim ---
result = client.predict(
    model="kullanici/smoke-detection",
    image="test.jpg",
    confidence=0.3,
)

print(f"Tespit: {result.count} nesne, {result.inference_ms:.0f} ms")
for det in result.predictions:
    print(f"  {det.class_name}: %{det.confidence:.0%}  bbox={det.bbox}")

# --- bytes ile cikarim ---
with open("test.jpg", "rb") as f:
    raw = f.read()

result2 = client.predict("kullanici/smoke-detection", raw)
print(f"\nbytes ile: {result2.count} nesne")
