L2Cs-Net
Use L2Cs-Net gaze detection model through our Serverless Cloud API
Code sample
3
Run the model
import os
import supervision as sv
from inference_sdk import InferenceHTTPClient
image = sv.load_image_from_url("https://media.roboflow.com/inference/man.jpg")
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}")Inference speed
Model
Latency (ms)
Use with Inference (self-hosted)
Execution modes in Workflows
Further reading
Last updated
Was this helpful?