L2Cs-Net
Serverless Hosted API를 통해 L2Cs-Net 시선 탐지 model을 사용합니다.
코드 샘플
3
모델을 실행하세요
import os
import cv2
import numpy as np
import requests
from inference_sdk import InferenceHTTPClient
content = requests.get("https://media.roboflow.com/inference/man.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"],
).select_api_v1()
result = client.detect_gazes(image)
for prediction in result[0]["predictions"]:
face = prediction["face"]
yaw = prediction["yaw"]
pitch = prediction["pitch"]
print(f"Face at ({face['x']}, {face['y']}) - yaw: {yaw:.3f}, pitch: {pitch:.3f}")추론 속도
모델
지연 시간(ms)
마지막 업데이트
도움이 되었나요?