YOLOv5
हमारे Serverless Cloud API के माध्यम से YOLOv5 मॉडल परिवार का उपयोग करें
कोड नमूना
3
मॉडल चलाएँ
import os
import cv2
import supervision as sv
from inference_sdk import InferenceHTTPClient
image = sv.load_image_from_url("https://media.roboflow.com/quickstart/traffic.jpg")
client = InferenceHTTPClient(
api_url="https://serverless.roboflow.com",
api_key=os.environ["ROBOFLOW_API_KEY"],
)
result = client.infer(image, model_id="your-workspace/your-model-slug")
detections = sv.Detections.from_inference(result)
annotated = sv.BoxAnnotator().annotate(image.copy(), detections)
annotated = sv.LabelAnnotator().annotate(annotated, detections)
cv2.imwrite("annotated.png", annotated)अंतिम अपडेट
क्या यह उपयोगी था?