# annotation_sizes

Python API: `depthai_nodes.utils.annotation_sizes`

## Classes

| Name | Description |
| --- | --- |
| [`AnnotationSizes`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/utils/annotation_sizes.md#annotation_sizes-Classes-AnnotationSizes) | Compute annotation dimensions from an image resolution. |

### class `AnnotationSizes`

```python
class AnnotationSizes
```

Compute annotation dimensions from an image resolution.

Pixel sizes scale with image height or the sum of width and height. Relative font sizes and spacing use image height as their
reference.

Properties

| Name | Description |
| --- | --- |
| [`aspect_ratio`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/utils/annotation_sizes.md#annotation_sizes-Classes-AnnotationSizes-aspect_ratio) | Image width divided by image height. |
| [`border_thickness`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/utils/annotation_sizes.md#annotation_sizes-Classes-AnnotationSizes-border_thickness) | Detection border thickness in pixels. |
| [`corner_size`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/utils/annotation_sizes.md#annotation_sizes-Classes-AnnotationSizes-corner_size) | Configured relative size of detection corners. |
| [`font_size`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/utils/annotation_sizes.md#annotation_sizes-Classes-AnnotationSizes-font_size) | Font size in pixels, proportional to image height. |
| [`font_space`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/utils/annotation_sizes.md#annotation_sizes-Classes-AnnotationSizes-font_space) | Text spacing equal to half the relative font size. |
| [`keypoint_thickness`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/utils/annotation_sizes.md#annotation_sizes-Classes-AnnotationSizes-keypoint_thickness) | Keypoint marker thickness in pixels. |
| [`relative_font_size`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/utils/annotation_sizes.md#annotation_sizes-Classes-AnnotationSizes-relative_font_size) | Font size divided by image height. |

Methods

| Name | Description |
| --- | --- |
| [`__init__`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/utils/annotation_sizes.md#annotation_sizes-Classes-AnnotationSizes-__init__) | Set the image resolution used by size calculations. |

#### property `aspect_ratio`

Image width divided by image height.

#### property `border_thickness`

Detection border thickness in pixels.

#### property `corner_size`

Configured relative size of detection corners.

#### property `font_size`

Font size in pixels, proportional to image height.

#### property `font_space`

Text spacing equal to half the relative font size.

#### property `keypoint_thickness`

Keypoint marker thickness in pixels.

#### property `relative_font_size`

Font size divided by image height.

#### method `__init__`

```python
def __init__(width: int, height: int)
```

Set the image resolution used by size calculations.

Args

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `width` | `int` | Image width in pixels. | required |
| `height` | `int` | Image height in pixels; must be nonzero for relative size calculations. | required |
