> 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) でトレーニングし、私たちの [サーバーレスホスト型 API](https://docs.roboflow.com/deployment/roboflow-cloud/serverless-api).

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

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>

Project でトレーニングを開始するときにバリエーションを選択します。トレーニングされたモデルはその後、Serverless Hosted API から提供され、モデルごとの `{workspace}/{model-slug}` の [バージョン、学習、モデル](/models/ja/versions-trainings-and-models.md)).

## コード例

{% 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` Serverless Hosted 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 %}
