# tfg.nn.metric.intersection_over_union.evaluate

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/graphics/blob/master/tensorflow_graphics/nn/metric/intersection_over_union.py#L29-L80) |

Computes the Intersection-Over-Union metric for the given ground truth and predicted labels.

    tfg.nn.metric.intersection_over_union.evaluate(
        ground_truth_labels: type_alias.TensorLike,
        predicted_labels: type_alias.TensorLike,
        grid_size: int = 1,
        name: str = 'intersection_over_union_evaluate'
    ) -> tf.Tensor

<br />

<br />

<br />

| ## Note ||
|---|---|
| In the following, A1 to An are optional batch dimensions, which must be broadcast compatible, and G1 to Gm are the grid dimensions. ||

<br />

<br />

<br />

<br />

| ## Args ||
|---|---|
| `ground_truth_labels` | A tensor of shape `[A1, ..., An, G1, ..., Gm]`, where the last m axes represent a grid of ground truth attributes. Each attribute can either be 0 or 1. |
| `predicted_labels` | A tensor of shape `[A1, ..., An, G1, ..., Gm]`, where the last m axes represent a grid of predicted attributes. Each attribute can either be 0 or 1. |
| `grid_size` | The number of grid dimensions. Defaults to 1. |
| `name` | A name for this op. Defaults to "intersection_over_union_evaluate". |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A tensor of shape `[A1, ..., An]` that stores the intersection-over-union metric of the given ground truth labels and predictions. ||

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `ValueError` | if the shape of `ground_truth_labels`, `predicted_labels` is not supported. |

<br />