YOLOv12
हमारे Serverless Hosted API के माध्यम से YOLOv12 object detection model का उपयोग करें
कोड नमूना
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/docs/bolts.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"],
)
result = client.infer(image, model_id="erik-pe6au/bolts-uzqzc-4-yolo12s-t1")
detections = sv.Detections.from_inference(result)
annotated = sv.BoxAnnotator().annotate(image.copy(), detections)
cv2.imwrite("annotated.png", annotated)
अंतिम अपडेट
क्या यह उपयोगी था?