Skip to content

Nesne Tespiti

Bir görseldeki nesneleri bulup her birinin etiketini + bounding box'ını (x, y, w, h) + güven skorunu döner.

Mevcut modeller

ModelÖzellik
spook-detect (önerilen)YOLO benzeri, gerçek zamanlı, 80+ COCO sınıfı

İki yol var

Yeni alias yolu (v2.0.0+, önerilen)

bash
curl https://app.qevron.ai/v1/vision/detect \
  -H "Authorization: Bearer sk-..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "spook-detect",
    "image": "data:image/jpeg;base64,...",
    "threshold": 0.5
  }'

Eski yol (custom_test)

bash
curl https://app.qevron.ai/api/channel/85/custom_test \
  -H "Authorization: Bearer sk-..." \
  -d '{"model": "spook-detect", "image": "data:image/jpeg;base64,..."}'

Python

python
import base64, requests

with open("sokak.jpg", "rb") as f:
    b64 = base64.b64encode(f.read()).decode()

resp = requests.post(
    "https://app.qevron.ai/v1/vision/detect",
    headers={"Authorization": "Bearer sk-..."},
    json={
        "model": "spook-detect",
        "image": f"data:image/jpeg;base64,{b64}",
        "threshold": 0.4,
    },
)
detections = resp.json().get("detections", [])
for d in detections:
    print(f"{d['label']:10s} score={d['score']:.2f}  bbox={d['bbox']}")

Yanıt şekli

json
{
  "detections": [
    {"label": "person",  "score": 0.92, "bbox": [120, 80, 240, 480]},
    {"label": "car",     "score": 0.88, "bbox": [600, 200, 320, 180]},
    {"label": "bicycle", "score": 0.71, "bbox": [50, 300, 90, 140]}
  ]
}

bbox formatı: [x, y, width, height] (sol-üst köşe + boyut, piksel cinsinden).

threshold

Hangi güven skoruna kadar dahil edilsin? Varsayılan 0.5:

  • 0.3 — daha fazla aday, daha çok yanlış pozitif
  • 0.5 — denge (önerilen)
  • 0.7 — sadece çok emin olduklarımız

Düşük threshold + sonradan client'ta filtre = en esnek pattern.

Görselin üzerine çizmek

python
from PIL import Image, ImageDraw

img = Image.open("sokak.jpg")
draw = ImageDraw.Draw(img)
for d in detections:
    x, y, w, h = d["bbox"]
    draw.rectangle([x, y, x+w, y+h], outline="red", width=3)
    draw.text((x, y-10), f"{d['label']} {d['score']:.2f}", fill="red")
img.save("ciktili.jpg")

Sorun çözme

  • Hiçbir şey bulamadı → threshold'u düşür (0.3) ya da görsel kalitesi düşük olabilir.
  • Yanlış sınıf → spook-detect COCO 80 sınıfla eğitilmiş; tıbbi/endüstriyel niş sınıflar için custom model lazım.
  • Çok yavaş → görseli 1280 px'e küçült. Detect modeli kare giriş ister, sunucu tarafı resize yapıyor ama büyük girdi network'te uzar.

Devam: OCR · Görsel üretimi

Qevron — AI gateway. Arpanet / OpenAI / Anthropic / Gemini uyumlu.