> For the complete documentation index, see [llms.txt](https://docs.roboflow.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roboflow.com/roboflow/roboflow-jp/deploy/supported-models/l2cs-net.md).

# L2Cs-Net

L2Cs-Net は、顔を検出し、各顔の yaw と pitch の角度を予測する gaze direction estimation model です。弊社の [Serverless Hosted API](/roboflow/roboflow-jp/deploy/serverless-hosted-api-v2.md).

## コードサンプル

次を呼び出します: `/gaze/gaze_detection` endpoint を直接使って `curl`:

```bash
curl --location 'https://serverless.roboflow.com/gaze/gaze_detection' \
  --header 'Content-Type: application/json' \
  --data '{
    "api_key": "YOUR_API_KEY",
    "image": {"type": "url", "value": "https://media.roboflow.com/inference/man.jpg"}
  }'
```

SDK から同じ呼び出しを行います。インストールしてください:

```bash
pip install inference-sdk
```

以下のコードサンプルは `detect_gazes`は、同じ `/gaze/gaze_detection` endpoint にアクセスします。あなたの [Roboflow API Key](https://app.roboflow.com/settings/api) を `API_KEY` env variable。

```python
import os
import urllib.request
from inference_sdk import InferenceHTTPClient

image_url = "https://media.roboflow.com/inference/man.jpg"
image_path = "man.jpg"
urllib.request.urlretrieve(image_url, image_path)

client = InferenceHTTPClient(
    api_url="https://serverless.roboflow.com",
    api_key=os.getenv("API_KEY"),
).select_api_v1()

result = client.detect_gazes(image_path)

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}")
```

{% hint style="info" %}
設定 `api_url` をデプロイ先に合わせて設定してください:

* `https://serverless.roboflow.com` は Serverless Hosted API 用です。
* `http://localhost:9001` ローカルの [Inference](https://inference.roboflow.com/) サーバー用です。
* あなたの [Dedicated Deployment](/roboflow/roboflow-jp/deploy/dedicated-deployments.md) の URL はプライベートエンドポイント用です。
  {% endhint %}

レスポンスには、次を含むリストが含まれています: `predictions` （それぞれが次を持ちます `face` bounding box, `landmarks`, `yaw`、および `pitch` （ラジアン単位）、 `time`, `time_face_det`、および `time_gaze_det`.

self-hosted deployments と追加の例については、次を参照してください: [Roboflow Inference docs](https://inference.roboflow.com/).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.roboflow.com/roboflow/roboflow-jp/deploy/supported-models/l2cs-net.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
