# Object Detection Model

### このブロックについて

Object Detection Model ブロックを使うと、Roboflow で学習した、または Roboflow にアップロードした object detection model を実行できます。

object detection model を使うと、画像内のカスタムオブジェクトを識別できます。たとえば、object detection ブロックを使って次のことができます:

1. 製品の欠陥を識別する
2. 道路上の車両の位置を見つける
3. 組立ライン上のアイテムを見つける

Workspace に保存されているプライベートモデル、または Roboflow Universe 上のパブリックモデルを実行できます。

<figure><img src="/files/db3d100ce754484a452e08ef6abf34a709cef70a" alt=""><figcaption><p>Object Detection Model ブロック。</p></figcaption></figure>

### このブロックに送信できるもの

Object Detection Model ブロックは次の対象に対して実行できます。

1. Workflow に送信する画像
2. Workflow に送信する動画フレーム
3. Workflow 内で計算される画像の切り抜かれた領域（つまり、Crop ブロックを使用）

### このブロックが返すもの

object detection model ブロックは、他のブロックで使用できる予測結果を返します。予測結果には、次の情報が含まれます:

* 検出された各オブジェクトの位置（xyxy 座標）
* 各オブジェクトの位置に関連付けられたクラス名

object detection model の結果を画像上にプロットして確認するには、Visualizer ブロックを使用する必要があります。次のものを使用するとよいでしょう:

* [Bounding Box Visualization](/roboflow/roboflow-jp/workflows/workflow-blocks/visualize-predictions/bounding-box-visualization.md): モデルが返したバウンディングボックスを表示します。
* Label Visualization: モデルが返したクラスラベルを表示します。

以下は、このブロックが返した object detection を、Bounding Box と Label の両方の visualization で可視化した例です:

<figure><img src="/files/4ccb51ad366159e30dce4b3ca88593139ae02f76" alt=""><figcaption><p>画像上に表示された object detection model の予測。</p></figcaption></figure>

### ブロックの設定方法

このブロックを設定すると、Workspace からモデルを選択するよう求められます。

<figure><img src="/files/e080e2bae428b83a3a4919c8567cd7275275e640" alt=""><figcaption></figcaption></figure>

Workspace 内のモデルを使うには、Your Models の一覧から選択します。

また、さまざまな base model と public model も利用できます。

次の中から選択できます:

* RF-DETR base や YOLO11 のような base model
* 車両検出や小売在庫検出のような特定のユースケース向けの推奨モデル

Universe にある任意のモデルの ID を指定することもできます。 [Universe でモデルを見つける方法を学ぶ。](/roboflow/roboflow-jp/universe/find-a-model-on-universe.md)

その後、Workflows エディタで利用可能なオプションを使ってブロックを設定できます。

最も一般的に設定されるプロパティは、モデルの confidence threshold と、特定の class の予測のみを返すための "Class Filter" ツールです。

### ユースケース

このブロックは、モデルの実行を含むあらゆる Workflow に役立ちます。

動画内のオブジェクトを追跡したい場合は、object detection model と Byte Tracker を組み合わせることができます。モデルはオブジェクトの位置を返し、Byte Tracker は動画全体でその位置を追跡します。

### 予測の形式

下のカードを展開すると、このブロックが返す JSON データを確認できます。

<details>

<summary>予測の形式</summary>

予測は次の形式で返されます。

```json
[
  {
    "model_predictions": {
      "image": {
        "width": 2048,
        "height": 1080
      },
      "predictions": [
        {
          "width": 795,
          "height": 808,
          "x": 883.5,
          "y": 676,
          "confidence": 0.985406219959259,
          "class_id": 0,
          "class": "can",
          "detection_id": "8797945b-bb46-4f35-b076-9a8f832b1bb0",
          "parent_id": "image"
        },
        {
          "width": 248,
          "height": 470,
          "x": 1924,
          "y": 845,
          "confidence": 0.9593697190284729,
          "class_id": 0,
          "class": "can",
          "detection_id": "0a61f2e5-0fd3-44e0-955b-1b66308dfab3",
          "parent_id": "image"
        }
      ]
    }
  }
]
```

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.roboflow.com/roboflow/roboflow-jp/workflows/workflow-blocks/run-a-model/object-detection-model.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
