<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#L224-L252) |

Pads bounding boxes by adding top and left offsets.

    tf.keras.utils.bounding_boxes.pad(
        boxes,
        top,
        left,
        height=None,
        width=None,
        bounding_box_format='xyxy'
    )

This function adds padding to the bounding boxes by increasing the 'top'
and 'left' coordinates by the specified amounts. The method assume the
input bounding_box_format is `xyxy`.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `boxes` | Bounding boxes to pad. Shape `(N, 4)` or `(batch, N, 4)`. |
| `top` | Vertical padding to add. |
| `left` | Horizontal padding to add. |
| `height` | Image height. Defaults to None. |
| `width` | Image width. Defaults to None. |
| `bounding_box_format` | The format of the input bounding boxes. Defaults to `"xyxy"`. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| Padded bounding boxes in the original format. ||

<br />