> 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/yololite.md).

# YOLOLite

YOLOlite は、低レイテンシーのデプロイとエッジハードウェア向けに設計された、Roboflow の軽量な物体検出モデルファミリーです。YOLOlite は a [Project](/roboflow/roboflow-jp/workspaces/key-concepts.md) Roboflow で学習し、私たちの [Serverless Hosted API](/roboflow/roboflow-jp/deploy/serverless-hosted-api-v2.md).

セルフホスト型デプロイについては、こちらを参照してください [Roboflow Inference](https://inference.roboflow.com/).

YOLOlite の入力サイズは、Roboflow 上での学習時に設定されます。

## 利用可能なバリアント

YOLOlite には 2 つのスケーリングファミリーがあります。標準セットとエッジ最適化セットです。各セットは 5 つのサイズで利用できます。

<table data-search="false"><thead><tr><th>ファミリー</th><th>バリアント</th></tr></thead><tbody><tr><td>標準</td><td><code>yololite-n</code>, <code>yololite-s</code>, <code>yololite-m</code>, <code>yololite-l</code>, <code>yololite-xl</code></td></tr><tr><td>エッジ</td><td><code>yololite-edge-n</code>, <code>yololite-edge-s</code>, <code>yololite-edge-m</code>, <code>yololite-edge-l</code>, <code>yololite-edge-xl</code></td></tr></tbody></table>

学習済みモデルはその後 Serverless Hosted API から提供され、そこでモデルごとの `{workspace}/{model-slug}` ID で呼び出すことができます（ [Versions, Trainings, and Models](/roboflow/roboflow-jp/train/versions-trainings-and-models.md)).

## コードサンプル

{% stepper %}
{% step %}

### API Key を取得する

Roboflow アカウントを作成し、キーを次の場所で見つけます [Roboflow API 設定ページ](https://app.roboflow.com/settings/api) そしてシェルで利用できるようにします:

```bash
export ROBOFLOW_API_KEY="your-key-here"
```

{% endstep %}

{% step %}

### 依存関係をインストールする

次をインストールします: [Inference SDK](https://inference.roboflow.com/inference_helpers/inference_sdk/) と [supervision](https://supervision.roboflow.com/):

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

{% endstep %}

{% step %}

### モデルを実行する

この例では、a で学習された公開 YOLOlite モデルを実行します [screws データセット](https://universe.roboflow.com/erik-pe6au/rf-bolts) (screw, flat-washer, hex-nut)。ご自身の `{workspace}/{model-slug}` を差し替えて、学習済み重みを実行してください。

```python
import os
import cv2
import numpy as np
import requests
import supervision as sv
from inference_sdk import InferenceHTTPClient

content = requests.get("https://media.roboflow.com/docs/bolts.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"],
)
results = client.infer(image, model_id="erik-pe6au/rf-bolts-4-yololite-s-t1")

detections = sv.Detections.from_inference(results)

annotated = sv.BoxAnnotator().annotate(image.copy(), detections)

cv2.imwrite("annotated.png", annotated)
```

<figure><img src="/files/ca6e3f6ddeb1c9c7774ad5cbe2bad466007ebe54" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

{% 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 %}
