<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tflite-support/blob/v0.4.4/tensorflow_lite_support/python/task/processor/proto/segmentations.proto) |

Represents one Segmentation object in the image segmenter's results.

    tflite_support.task.processor.Segmentation(
        height: int,
        width: int,
        colored_labels: List[https://developers.google.com/edge/api/tflite/python/tflite_support/task/processor/ColoredLabel],
        category_mask: Optional[np.ndarray] = None,
        confidence_masks: Optional[List[ConfidenceMask]] = None
    )

<br />

<br />

<br />

| ## Attributes ||
|---|---|
| `height` | The height of the mask. This is an intrinsic parameter of the model being used, and does not depend on the input image dimensions. |
| `width` | The width of the mask. This is an intrinsic parameter of the model being used, and does not depend on the input image dimensions. |
| `colored_labels` | A list of `ColoredLabel` objects. |
| `category_mask` | A NumPy 2D-array of the category mask. |
| `confidence_masks` | A list of `ConfidenceMask` objects. |

<br />

## Methods

### `create_from_pb2`

[View source](https://github.com/tensorflow/tflite-support/blob/v0.4.4/tensorflow_lite_support/python/task/processor/proto/segmentations.proto)

    @classmethod
    create_from_pb2(
        pb2_obj: _SegmentationProto
    ) -> 'Segmentation'

Creates a `Segmentation` object from the given protobuf object.

### `to_pb2`

[View source](https://github.com/tensorflow/tflite-support/blob/v0.4.4/tensorflow_lite_support/python/task/processor/proto/segmentations.proto)

    to_pb2() -> _SegmentationProto

Generates a protobuf object to pass to the C++ layer.

### `__eq__`

[View source](https://github.com/tensorflow/tflite-support/blob/v0.4.4/tensorflow_lite_support/python/task/processor/proto/segmentations.proto)

    __eq__(
        other: Any
    ) -> bool

Checks if this object is equal to the given object.

<br />

<br />

<br />

| Args ||
|---|---|
| `other` | The object to be compared with. |

<br />

<br />

<br />

<br />

| Returns ||
|---|---|
| True if the objects are equal. ||

<br />

<br />

<br />

<br />

| ## Class Variables ||
|---|---|
| category_mask | `None` |
| confidence_masks | `None` |

<br />