# detection_config_generator

Python API: `depthai_nodes.node.utils.detection_config_generator`

## Functions

### generate_script_content

```python
def generate_script_content(resize_width: int, resize_height: int, resize_mode: str = 'STRETCH', padding: float = 0.0) -> str:
```

Generates the script content for the dai.Script node.

It crops and resizes the input image based on the detected object, with optional padding. If a zero-area detection is encountered,
an error message is issued.

Parameters

 * `resize_width` (`int`): Target width for the resized image
 * `resize_height` (`int`): Target height for the resized image
 * `resize_mode` (`str`): Resize mode for the image. Supported values: "CENTER_CROP", "LETTERBOX", "NONE", "STRETCH". Default:
   "STRETCH". "STRETCH" - stretches the image so that the corners of the region are now in the corners of the output image.
   "CENTER_CROP" - resizes + crops the image to keep aspect ratio and fill the final size. "LETTERBOX" - resizes + pads the image
   to the final size to keep aspect ratio. "NONE" - does not scale and pads top, bottom, left and right to fill the final image.
 * `padding` (`float`): Additional padding around the detection in normalized coordinates (0-1)

Returns

 * `str`: Generated script content as a string
