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

# YOLOv10

YOLOv10 は、推論経路から Non-Maximum Suppression を हटしてレイテンシを下げる物体検出モデルです。Roboflow では COCO で事前学習済みの YOLOv10 チェックポイントを短いエイリアスで提供しており、 [独自の重みをアップロードして](/models/ja/moderunomi/upload-custom-weights.md) 他で学習したモデルを実行できます。

Roboflow で YOLOv10 の学習はサポートされていません。Roboflow で学習した検出器については、 [RF-DETR](/models/ja/supported-models/rf-detr.md), [YOLO26](/models/ja/supported-models/yolo26.md)、または [YOLO11](/models/ja/supported-models/yolo11.md).

## 事前学習済みエイリアス

次のいずれかの ID を `model_id` として渡すと、何も学習せずに COCO で事前学習済みのチェックポイントを実行できます。完全な一覧は [事前学習済みモデルのエイリアス](/models/ja/pretrained-aliases.md) ページにあります。

| モデル      | 入力サイズ | タスク  | モデルID          | テスト                                                               |
| -------- | ----- | ---- | -------------- | ----------------------------------------------------------------- |
| YOLOv10n | 640   | 物体検出 | `yolov10n-640` | [ブラウザでテスト](https://universe.roboflow.com/microsoft/coco/model/19) |
| YOLOv10s | 640   | 物体検出 | `yolov10s-640` | [ブラウザでテスト](https://universe.roboflow.com/microsoft/coco/model/20) |
| YOLOv10m | 640   | 物体検出 | `yolov10m-640` | [ブラウザでテスト](https://universe.roboflow.com/microsoft/coco/model/21) |
| YOLOv10b | 640   | 物体検出 | `yolov10b-640` | [ブラウザでテスト](https://universe.roboflow.com/microsoft/coco/model/22) |
| YOLOv10l | 640   | 物体検出 | `yolov10l-640` | [ブラウザでテスト](https://universe.roboflow.com/microsoft/coco/model/23) |
| YOLOv10x | 640   | 物体検出 | `yolov10x-640` | [ブラウザでテスト](https://universe.roboflow.com/microsoft/coco/model/24) |

## コードサンプル

{% stepper %}
{% step %}

### APIキーを取得する

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

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

{% endstep %}

{% step %}

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

Inference SDK と [supervision](https://supervision.roboflow.com/) をインストールして、予測のデコードと描画に使います:

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

{% endstep %}

{% step %}

### モデルを実行する

この例では、事前学習済みの `yolov10n-640` チェックポイントを実行します。独自の重みを提供するには、 `{workspace}/{model-slug}` の [Versions, Trainings, and Models](/models/ja/versions-trainings-and-models.md)).

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

image = sv.load_image_from_url("https://media.roboflow.com/inference/people-walking.jpg")

client = InferenceHTTPClient(
    api_url="https://serverless.roboflow.com",
    api_key=os.environ["ROBOFLOW_API_KEY"],
)
results = client.infer(image, model_id="yolov10n-640")

detections = sv.Detections.from_inference(results)

labels = [
    f"{name} {conf:.2f}"
    for name, conf in zip(detections.data["class_name"], detections.confidence)
]
annotated = sv.BoxAnnotator().annotate(image.copy(), detections)
annotated = sv.LabelAnnotator().annotate(annotated, detections, labels=labels)
cv2.imwrite("annotated.png", annotated)
```

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

また、 [`inference`](https://docs.roboflow.com/deployment/self-hosted/self-hosted) パッケージを使って、チェックポイントをプロセス内で読み込むこともできます:

```python
from inference import get_model

model = get_model(model_id="yolov10n-640")
results = model.infer("https://media.roboflow.com/inference/people-walking.jpg")
```
