> 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/burokku/blocks/advanced-blocks/overlap-analysis.md).

# 重なり解析

2つの検出集合間で、ペアごとの幾何学的な重なりを計算します。

から取得される各ペア（reference, candidate）について `reference_predictions` x `candidate_predictions`、このブロックは次を計算します `intersection_area / reference_polygon.area` そして、その比率に達した各ペアごとに1件のレコードを出力します `min_overlap`.

検出にマスクが付いている場合、正確なポリゴンはそのマスクの最長輪郭（shapelyで検証済み）です。そうでない場合は、バウンディングボックスのポリゴンが使用されます。ベクトル化された bbox-IoU の事前フィルタ（`supervision.box_iou_batch`）は、shapely の交差計算を行う前に、接していないペアを除外します。

関係は意図的に **対称ではありません** 2つの入力の間で成り立ちます。分母は常に参照検出の面積です。別の集合に対する重なりとして報告したい場合は、2つのセレクタを入れ替えてください。

出力は、入力と同じ次元に対応付けられた dict のフラットなリスト（承認されたペアごとに1件）です。このブロックは次元を増やしません。以下を参照してください: `detections_overlaps` 各レコードのスキーマについては kind のドキュメントを参照してください。

### 型識別子

ステップで次の識別子を使用してください `"type"` フィールド： `roboflow_core/overlap_analysis@v1` ワークフローにこのブロックをステップとして追加するには。

### プロパティ

| **名前**        | **型**   | **説明**                                             | 参照 |
| ------------- | ------- | -------------------------------------------------- | -- |
| `name`        | `str`   | このステップの一意の識別子を入力してください。                            | ❌  |
| `min_overlap` | `float` | ペアを出力に含めるための最小の（intersection / reference\_area）比率。 | ✅  |

この **参照** 列は、で利用可能な動的値を使ってプロパティをパラメータ化できる可能性を示します `ワークフロー` 実行時。参照 *バインディング* 詳細は。

### 入力と出力のバインディング

利用可能な接続は、そのバインディング種別によって異なります。どのバインディング種別が `重なり分析` のバージョン `v1` あるか確認してください。

<details>

<summary>入力と出力のバインディング</summary>

* 入力
  * `reference_predictions` (*Union\[*[*`object_detection_prediction`*](/workflows/ja/gaido/developer-guide/kinds/object-detection-prediction.md)*,* [*`instance_segmentation_prediction`*](/workflows/ja/gaido/developer-guide/kinds/instance-segmentation-prediction.md)*]*）: 重なり比率の分母となる面積を持つ検出です。各参照検出ごとに、すべての候補との重なりが計算されます。以上のペアは `min_overlap` 出力に現れます。
  * `candidate_predictions` (*Union\[*[*`object_detection_prediction`*](/workflows/ja/gaido/developer-guide/kinds/object-detection-prediction.md)*,* [*`instance_segmentation_prediction`*](/workflows/ja/gaido/developer-guide/kinds/instance-segmentation-prediction.md)*]*）: 各参照に対してチェックされる検出です。
  * `min_overlap` ([*`float_zero_to_one`*](/workflows/ja/gaido/developer-guide/kinds/float-zero-to-one.md)）: ペアを出力に含めるための最小の（intersection / reference\_area）比率。
* 出力
  * `overlaps` ([`detections_overlaps`](/workflows/ja/gaido/developer-guide/kinds/detections-overlaps.md)）: ペアごとの検出重なりレコードの一覧。

</details>

<details>

<summary>JSON 定義の例</summary>

```json
{
	    "name": "<your_step_name_here>",
	    "type": "roboflow_core/overlap_analysis@v1",
	    "reference_predictions": "$steps.model_a.predictions",
	    "candidate_predictions": "$steps.model_b.predictions",
	    "min_overlap": 0.1
	}
```

</details>
