> 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/rle-instance-segmentation-prediction.md).

# rleinstancesegmentationprediction 型

sv.Detections(...) オブジェクト形式の、検出されたバウンディングボックスと RLE エンコードされたセグメンテーションマスクを含む予測。

検出されたバウンディングボックスとRLEエンコードされたセグメンテーションマスクを、sv.Detections(...) オブジェクトの形式で表した予測

## データ表現

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

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

### 外部

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

型: `dict`

### 内部

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

型: `sv.Detections`

## 詳細

この種類は、RLE（Run-Length Encoding）マスクを含むインスタンスセグメンテーション予測を、 [`sv.Detections(...)`](https://supervision.roboflow.com/latest/detection/core/) オブジェクトです。

マスクは `sv.Detections.data["rle_mask"]` COCO形式のRLE辞書の numpy 配列として保存されます: `{"size": [H, W], "counts": "encoded_string"}`.

`size` は、カウントがエンコードされたグリッドを表します。インスタンスセグメンテーションモデルのブロックは画像解像度のマスクを保持します。縮小グリッドのワークフローへの対応は後回しにされています。

可視化ブロックが numpy マスクを必要とする場合、pycocotools を使用して必要に応じて RLE をデコードします。

例:

```
sv.Detections(
    xyxy=array([[        127,         189,         322,         303]]),
    mask=None,  # Initially None, populated lazily when needed
    confidence=array([    0.95898]),
    class_id=array([6]),
    tracker_id=None,
    data={
        'class_name': array(['人'], dtype='<U6'),
        'detection_id': array(['51dfa8d5-261c-4dcb-ab30-9aafe9b52379'], dtype='<U36'),
        'parent_id': array(['image.[0]'], dtype='<U9'),
        'image_dimensions': array([[425, 640]]),
        'prediction_type': array(['rle-instance-segmentation'], dtype='<U26'),
        'rle_masks': array([{'size': [425, 640], 'counts': 'encoded_rle_string'}], dtype=object),
        # ... その他の標準フィールド
    }
)
```

**シリアライゼーション:** InstanceSegmentationInferenceResponse と同様のエンティティ詳細ですが、ポリゴンの代わりに RLE マスクを使用します。RLE 形式は COCO 標準に従い、pycocotools.mask.decode() を使用してデコードできます。
