YOLO-NAS
YOLO-NAS 객체 감지 모델을 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="yolo-nas-s-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)from inference import get_model
model = get_model(model_id="yolo-nas-s-640")
results = model.infer("https://media.roboflow.com/inference/people-walking.jpg")마지막 업데이트
도움이 되었나요?