<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/keras-team/keras/tree/v3.15.1/keras/src/layers/preprocessing/image_preprocessing/bounding_boxes/converters.py#L347-L448) |

Converts bounding boxes from delta format to the specified `box_format`.

    tf.keras.utils.bounding_boxes.decode_deltas_to_boxes(
        anchors,
        boxes_delta,
        anchor_format,
        box_format,
        encoded_format='center_yxhw',
        variance=None,
        image_shape=None
    )

This function decodes bounding box deltas relative to anchors to obtain the
final bounding box coordinates. The boxes are encoded in a specific
`encoded_format` (center_yxhw by default) during the decoding process.
This allows flexibility in how the deltas are applied to the anchors.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `anchors` | Can be `Tensors` or `Dict[Tensors]` where keys are level indices and values are corresponding anchor boxes. The shape of the array/tensor should be `(N, 4)` where N is the number of anchors. boxes_delta Can be `Tensors` or `Dict[Tensors]` Bounding box deltas must have the same type and structure as `anchors`. The shape of the array/tensor can be `(N, 4)` or `(B, N, 4)` where N is the number of boxes. |
| `anchor_format` | str. The format of the input `anchors`. (e.g., `"xyxy"`, `"xywh"`, etc.) |
| `box_format` | str. The desired format for the output boxes. (e.g., `"xyxy"`, `"xywh"`, etc.) |
| `encoded_format` | str. Raw output format from regression head. Defaults to `"center_yxhw"`. |
| `variance` | `List[floats]`. A 4-element array/tensor representing variance factors to scale the box deltas. If provided, the deltas are multiplied by the variance before being applied to the anchors. Defaults to None. |
| `image_shape` | `Tuple[int]`. The shape of the image (height, width, 3). When using relative bounding box format for `box_format` the `image_shape` is used for normalization. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| Decoded box coordinates. The return type matches the `box_format`. ||

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `ValueError` | If `variance` is not None and its length is not 4. |
| `ValueError` | If `encoded_format` is not `"center_xywh"` or `"center_yxhw"`. |

<br />