> 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/blocks/blocks/transformations/detection-offset.md).

# Detection Offset

Add padding around detected regions.

### About this block

The Detection Offset block lets you add a padding around regions detected by an object detection model or segmentation model.

This block is useful if you want to add space around a detection. You may want to do this if you want to see some background around the detected regions in an image.

This block works with:

* Object detection models
* Segmentation models

<figure><img src="https://1126624165-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoO0Ceoy9R0lHDZATcPyh%2Fuploads%2Fgit-blob-916959bfb86eb1f02927b1b7fc557f3ce303e13e%2FScreenshot%202025-05-23%20at%2019.27.27.png?alt=media" alt=""><figcaption><p>The Detection Offset block.</p></figcaption></figure>

### What you can send into this block

To use this block, you need:

1. An input image, video frame, or a cropped region in your image, and;
2. Predictions from an Object Detection or Segmentation model.

### What this block returns

The Detection Offset block returns a version of the xyxy coordinates returned by a detection model. These coordinates have padding (space).

These coordinates can then be passed into any block that supports detections (i.e. an OCR Model, or a Bounding Box Visualization).

Here is an example showing raw detections displayed with a Bounding Box Visualization (left) and detections to which an offset (padding) has been applied:

<figure><img src="https://1126624165-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoO0Ceoy9R0lHDZATcPyh%2Fuploads%2Fgit-blob-783fd779acf184caa0f6559f741bc064dc9ca018%2FScreenshot%202025-05-23%20at%2019.21.57.png?alt=media" alt=""><figcaption><p>The defect in the image is magnified.</p></figcaption></figure>

For reference, here is the input image:

<figure><img src="https://1126624165-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoO0Ceoy9R0lHDZATcPyh%2Fuploads%2Fgit-blob-964f65273dbc00899cfda43b906a0ec2aeb5c698%2F0.jpg?alt=media" alt=""><figcaption></figcaption></figure>

In the result from the block, the detected region is made bigger.

### Use cases

This block is useful if you want to see the results from a model on an image. This is common during testing.

Because visualizing predictions adds a small amount of overhead to running a Workflow, we only recommend adding a Visualization in production if you need to see the location of results from your model.
