> 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) Roboflow で、そして私たちの [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>Standard</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 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 %}

### モデルを実行する

この例では、ある公開 YOLOlite モデルを実行します。これは、ある [ねじデータセット](https://universe.roboflow.com/erik-pe6au/rf-bolts) （ねじ、平ワッシャー、六角ナット）。独自の `{workspace}/{model-slug}` あなたの学習済み重みを実行するために。

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

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"],
).configure(InferenceConfiguration(api_key_transport="header"))
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) サーバー用。
* あなたの [Dedicated Deployment](https://docs.roboflow.com/deployment/roboflow-cloud/dedicated-deployments) プライベートエンドポイント用のURL。
  {% endhint %}
