YOLOv10
YOLOv10 物体検出モデルを Serverless Cloud API で使用します
事前学習済みエイリアス
モデル
入力サイズ
タスク
モデル ID
テスト
コードサンプル
3
モデルを実行する
import os
import cv2
import supervision as sv
from inference_sdk import InferenceHTTPClient
image = sv.load_image_from_url("https://media.roboflow.com/inference/people-walking.jpg")
client = InferenceHTTPClient(
api_url="https://serverless.roboflow.com",
api_key=os.environ["ROBOFLOW_API_KEY"],
)
results = client.infer(image, model_id="yolov10n-640")
detections = sv.Detections.from_inference(results)
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)最終更新
役に立ちましたか?