# keypoints

Python API: `depthai_nodes.message.creators.keypoints`

## Functions

| Name | Description |
| --- | --- |
| [`create_keypoints_message`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/creators/keypoints.md#keypoints-Functions-create_keypoints_message) | Create keypoints with optional confidence filtering and skeleton edges. |

### function `create_keypoints_message`

```python
def create_keypoints_message(
    keypoints: np.ndarray | list[list[float]],
    scores: np.ndarray | list[float] | None = None,
    confidence_threshold: float | None = None,
    label_names: list[str] | None = None,
    edges: list[tuple[int, int]] | None = None,
) -> dai.beta.Keypoints
```

Create keypoints with optional confidence filtering and skeleton edges.

Args

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `keypoints` | `np.ndarray | list[list[float]]` | Array or list of points of shape `(N, 2)` or `(N, 3)`. Lists must contain floating-point coordinates. Values are copied without scaling or clipping; 2D points receive Z=0. Empty input is supported. | required |
| `scores` | `np.ndarray | list[float] | None` | Optional floating-point confidences in [0, 1], one per point. Omitted scores produce confidence -1. | `None` |
| `confidence_threshold` | `float | None` | Optional float in [0, 1]. Points below it are removed only when scores are supplied. | `None` |
| `label_names` | `list[str] | None` | Optional list of strings with one entry available for every point retained from the input. | `None` |
| `edges` | `list[tuple[int, int]] | None` | Optional pairs of original point indexes. Edges incident to removed or absent points are dropped, and retained indexes are remapped. | `None` |

Returns

| Type | Description |
| --- | --- |
| `dai.beta.Keypoints` | Native keypoints message containing retained coordinates, confidences, names, and edges. |

Raises

| Type | Description |
| --- | --- |
| `ValueError` | If points, scores, threshold, names, or edges fail type, shape, or value validation. |
| `IndexError` | If `label_names` has no entry for a retained input point. |
