> 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/workflows/ja/gaido/developer-guide/kinds/qr-code-detection.md).

# qrcodedetection 型

QRコード検出による予測

## データ表現

{% hint style="warning" %}
**データ表現**

この種類は内部表現と外部表現が異なります。 **外部** 表現はワークフローとの統合に関係し、 **内部** 一方は、Workflowsブロックの開発に役立つ実装上の詳細です。
{% endhint %}

### 外部

外部データ表現は Workflows クライアントに関連します。これは、データの入力および出力形式を規定します。

型: `dict`

### 内部

内部データ表現は Workflows ブロック作成者に関連します。これは、実行エンジンが実行時に、この種類の入力を受け取るブロックへ提供する型です。

型: `sv.Detections`

## 詳細

この種類は、QRコードの位置とそれらが提供するデータに関する予測のバッチを表します。

例:

```
sv.Detections(
    xyxy=array([
       [        865,       153.5,        1189,       422.5],
       [      192.5,        77.5,       995.5,       722.5],
       [        194,          82,         996,         726],
       [        460,         333,         704,         389]]
    ), 
    mask=None, 
    confidence=array([    1.0, 1.0, 1.0, 1.0]), 
    class_id=array([2, 7, 2, 0]), 
    tracker_id=None, 
    data={
        'class_name': array(['qr_code', 'qr_code', 'qr_code', 'qr_code'], dtype='<U13')
        'detection_id': array([
            '51dfa8d5-261c-4dcb-ab30-9aafe9b52379', 'c0c684d1-1e30-4880-aedd-29e67e417264'
            '8cfc543b-9cfe-493b-b5ad-77afed7bee83', 'c0c684d1-1e30-4880-aedd-38e67e441454'
        ], dtype='<U36'),
        'parent_id': array(['image.[0]', 'image.[0]', 'image.[0]', 'image.[0]'], dtype='<U9'),
        'image_dimensions': array([[425, 640], [425, 640], [425, 640], [425, 640]]),
        'inference_id': array([
            '51dfa8d5-261c-4dcb-ab30-9aafe9b52379', 'c0c684d1-1e30-4880-aedd-29e67e417264'
            '8cfc543b-9cfe-493b-b5ad-77afed7bee83', 'c0c684d1-1e30-4880-aedd-38e67e441454'
        ], dtype='<U36'),
        'prediction_type': array([
            'qrcode-detection', 'qrcode-detection', 
            'qrcode-detection', 'qrcode-detection'
        ], dtype='<U16'),
        'root_parent_id': array(['image.[0]', 'image.[0]', 'image.[0]', 'image.[0]'], dtype='<U9'),
        'root_parent_coordinates': array([[0, 0], [0, 0], [0, 0], [0, 0]]),
        'root_parent_dimensions': array([[425, 640], [425, 640], [425, 640], [425, 640]]),
        'parent_coordinates': array([[0, 0], [0, 0], [0, 0], [0, 0]]),
        'parent_dimensions': array([[425, 640], [425, 640], [425, 640], [425, 640]]),
        'scaling_relative_to_parent': array([1, 1, 1, 1]),
        'scaling_relative_to_root_parent': array([1, 1, 1, 1]),
        'data': np.array(['qr-code-1-data', 'qr-code-2-data', 'qr-code-3-data', 'qr-code-4-data'])
    }
)
```

ご覧のとおり、私たちは supervision が管理する予測用の標準メタデータセットを拡張しました。 `supervision`。このメタデータを追加するのは、 `roboflow_core` plugin

のブロックとの互換性を確保するために必要です。メタデータの設計は最適ではありません（画像全体に関するメタデータがすべてのバウンディングボックスに重複しており、空の予測のメタデータを保存する方法がありません）。私たちは [GH issue](https://github.com/roboflow/inference/issues/567) でこの問題について伝えています。

**追加フィールドの詳細：**

* `detection_id` - 各検出に対する一意の識別子。特定の検出に基づいて依存要素が作成される場合に使用されます（例：Dynamic Crop はこの値を新しい画像の親 ID として使用します）
* `parent_id` - 予測を生成した画像の識別子（ `WorkflowImageData` object
* `image_dimensions` - 予測の基準となった画像のサイズ - 形式： `(height, width)`
* `inference_id` - 推論リクエストの識別子（任意。Roboflow モデルに関連）
* `予測タイプ` - 予測の種類
* `root_parent_id` - 下流の予測の責任を負う主要な Workflow 入力の識別子（ `WorkflowImageData` object
* `root_parent_coordinates` - 元の入力に関するオフセット - 形式 (`offset_x`, `offset_y`)
* `root_parent_dimensions` - 元の入力画像のサイズ `(height, width)`
* `parent_coordinates` - 親に関するオフセット - 形式 (`offset_x`, `offset_y`)
* `parent_dimensions` - 親画像のサイズ `(height, width)`
* `scaling_relative_to_parent` - 親画像に対するスケーリング係数
* `scaling_relative_to_root_parent` - 元の入力画像に対するスケーリング係数
* `データ` - 抽出された QR コード

**シリアライズ：** API の背後にある Execution Engine は、この種類のセレクタが Workflow の出力として宣言されると、基礎データをシリアライズします。シリアライズは次のように実行されます `sv.Detections.from_inference(...)` は出力をデコードできます。エンティティの詳細： [ObjectDetectionInferenceResponse](https://detect.roboflow.com/docs)
