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

# YOLOlite

YOLOlite は、Roboflow の軽量な物体検出モデル群で、低レイテンシのデプロイやエッジハードウェア向けに設計されています。YOLOlite は、 [プロジェクト](https://docs.roboflow.com/platform/workspaces/key-concepts) で学習し、当社の [Serverless Cloud API](https://docs.roboflow.com/deployment/roboflow-cloud/serverless-api).

セルフホスト型デプロイについては、 [Roboflow Inference](https://docs.roboflow.com/deployment/self-hosted/self-hosted).

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

## 利用可能な YOLOlite のバリエーション

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 Cloud API から提供され、モデルごとの `{workspace}/{model-slug}` ID（参照 [バージョン、トレーニング、モデル](/models/ja/versions-trainings-and-models.md)).

## YOLOlite API

{% stepper %}
{% step %}

### API キーを取得する

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

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

{% endstep %}

{% step %}

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

次をインストールします: [Inference SDK](https://docs.roboflow.com/reference/inference/inference-sdk) および [supervision](https://supervision.roboflow.com/):

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

{% endstep %}

{% step %}

### モデルを実行する

この例では、ある [ねじデータセット](https://universe.roboflow.com/erik-pe6au/rf-bolts) （screw、flat-washer、hex-nut）で学習されています。独自の `{workspace}/{model-slug}` で学習された公開 YOLOlite モデルを実行します。

```python
import os
import cv2
import supervision as sv
from inference_sdk import InferenceHTTPClient

image = sv.load_image_from_url("https://media.roboflow.com/docs/bolts.jpg")

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/ddfcb9f916c9ec08bcaef392a1be25fe2b6e46c7" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

{% hint style="info" %}
次を設定します: `api_url` をデプロイ先に合わせて設定します:

* `https://serverless.roboflow.com` サーバーレスクラウド API 用。
* `http://localhost:9001` ローカル [Inference](https://docs.roboflow.com/deployment/self-hosted/self-hosted) サーバー。
* プライベートエンドポイントの [専用デプロイメント](https://docs.roboflow.com/deployment/roboflow-cloud/dedicated-deployments) URL。
  {% endhint %}
