YOLO-World
हमारे Serverless Hosted API के माध्यम से YOLO-World open-vocabulary object detection का उपयोग करें
कोड नमूना
2
मॉडल चलाएँ
curl --location 'https://serverless.roboflow.com/yolo_world/infer' \
--header 'Content-Type: application/json' \
--data '{
\"api_key\": \"'\"$ROBOFLOW_API_KEY\"'\",
"image": {"type": "url", "value": "https://media.roboflow.com/quickstart/traffic.jpg"},
"text": ["car", "truck"],
"yolo_world_version_id": "v2-s",
"confidence": 0.05
}'3
मॉडल चलाएँ
import os
import cv2
import numpy as np
import requests
import supervision as sv
from inference_sdk import InferenceHTTPClient
content = requests.get("https://media.roboflow.com/quickstart/traffic.jpg").content
image = cv2.imdecode(np.frombuffer(content, np.uint8), cv2.IMREAD_COLOR)
client = InferenceHTTPClient(
api_url="https://serverless.roboflow.com",
api_key=os.environ["ROBOFLOW_API_KEY"],
)
results = client.infer_from_yolo_world(
inference_input=image,
class_names=["car", "truck"],
model_version="v2-s",
confidence=0.05,
)
detections = sv.Detections.from_inference(results[0])
labels = [
f"{name} {conf:.2f}"
for name, conf in zip(detections.data["class_name"], detections.confidence)
]
annotated = sv.BoxAnnotator().annotate(image.copy(), detections)
annotated = sv.LabelAnnotator().annotate(annotated, detections, labels=labels)
cv2.imwrite("annotated.png", annotated)
Inference speed
मॉडल
विलंबता (ms)
अंतिम अपडेट
क्या यह उपयोगी था?