> 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/models/ja/supported-models/l2cs-net.md).

# L2CS-Net

L2CS-Net の視線検出は Roboflow のサーバーでは非推奨です。inferencejs を使えば、ブラウザ上では引き続き実行できます。

L2CS-Netは視線方向を推定するモデルです。画像内の顔を検出し、それぞれの顔がどこを見ているかをヨー角とピッチ角で予測します。

{% hint style="warning" %}
L2CS-NetはRoboflowのサーバーでは非推奨になっています。GoogleのMediaPipeに依存していましたが、MediaPipeはメンテナンスが終了しており、 [Roboflow Inference](https://docs.roboflow.com/deployment/self-hosted/self-hosted) はバージョン1.2.8でこれを削除しました。Serverless Cloud APIおよびセルフホスト型のInference 1.2.8以降では実行できません。 `/gaze/gaze_detection` エンドポイント、Python SDKの `detect_gazes` メソッド、Workflowsの「Gaze Detection」ブロックはいずれも `FeatureDeprecatedError` （HTTP 410 Gone）を発生させます。サーバー上で視線検出が必要な場合は、Roboflowにお問い合わせください。
{% endhint %}

## ブラウザーで視線検出を実行する

この [`inferencejs`](https://docs.roboflow.com/deployment/self-hosted/sdks/web-browser/inferencejs) ブラウザー SDK はユーザーのデバイス上で視線検出を実行し、Roboflow Inference に依存しません。モデル名 `gaze` とバージョンを指定してワーカーを起動します。 `1`:

```typescript
import { InferenceEngine } from "inferencejs";

const inferEngine = new InferenceEngine();
const workerId = await inferEngine.startWorker("gaze", 1, "[publishable key]");

const video = document.getElementById("video"); // a webcam <video> element
const gazes = await inferEngine.infer(workerId, video);
```

各結果には、目の位置に加えて、 `yaw` と `pitch` がラジアン単位で含まれます。型の全容については、 [`GazeDetections`](https://docs.roboflow.com/deployment/self-hosted/sdks/web-browser/inferencejs-reference#gazedetections) を参照してください。yaw と pitch を画面上の点に変換する方法については、 [視線検出ガイド](https://blog.roboflow.com/gaze-direction-position/).
