# Single-Label Classification Model

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

Single-Label Classification Model ブロックを使用すると、Roboflow で学習された、または Roboflow にアップロードされた単一ラベル分類モデルを実行できます。

単一ラベル分類モデルは、画像に対してカテゴリを返します。たとえば、このブロックを次のような用途に使えます。

1. 画像内にどの欠陥があるかを識別する
2. 画像を1つ以上のカテゴリに分類する
3. 画像内の製品の種類を識別する

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

<figure><img src="/files/1fcfe2fe5242d47bf6411b4e41133bdfff6cc031" alt=""><figcaption><p>Single-Label Classification Model ブロック。</p></figcaption></figure>

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

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

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

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

Single-Label Classification Model ブロックは、モデルが画像の内容を最も近く表していると考えるクラスを返します。また、モデルが結果にどれだけ自信を持っているかを示す confidence 値も返します。

分類モデルの結果を画像上に表示するには、Visualizer ブロックを使用する必要があります。次のものを使用するとよいでしょう。

* Classification Label Visualization ブロック：分類モデルのラベルを画像上に表示します。

以下は、Classification label Visualization を使用して単一ラベル分類モデルの結果を示した例です。

<figure><img src="/files/5af6e9ce4c7fd60ef8bfe6e7b9a8f2350e06ddf4" alt=""><figcaption><p>ラベル「loose-straw」が画像の左上隅に表示されています。</p></figcaption></figure>

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

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

<figure><img src="/files/347d14ec8d3f314b7bdcae605b0200471ff259a5" alt=""><figcaption></figcaption></figure>

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

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

Universe モデルを使用するには、Public Models タブに移動して、使用したいモデルの Universe Model ID を貼り付けます。

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

### ユースケース

このブロックは、分類モデルの実行を含むあらゆる Workflow に便利です。

ゼロショット分類モデルが必要な場合は、CLIP を使用するか、Claude のようなマルチモーダルモデルを試すとよいでしょう。

### 予測の形式

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

<details>

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

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

```json
[
    "model_predictions": {
      "inference_id": "866010bb-e432-4b9c-9b95-35d87f0ffafa",
      "time": 0.28171608800039394,
      "image": {
        "width": 960,
        "height": 1280
      },
      "predictions": [
        {
          "class": "loose-straw",
          "class_id": 4,
          "confidence": 0.5229
        }
      ],
      "top": "loose-straw",
      "confidence": 0.5229,
      "prediction_type": "classification",
      "parent_id": "image",
      "root_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/single-label-classification-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.
