# keypoints

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

## Functions

### 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.

Parameters

 * `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.
 * `scores` (`np.ndarray | list[float] | None`): Optional floating-point confidences in [0, 1], one per point. Omitted scores
   produce confidence -1.
 * `confidence_threshold` (`float | None`): Optional float in [0, 1]. Points below it are removed only when scores are supplied.
 * `label_names` (`list[str] | None`): Optional list of strings with one entry available for every point retained from the input.
 * `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.

Returns

 * `dai.beta.Keypoints`: Native keypoints message containing retained coordinates, confidences, names, and edges.

Raises

 * `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.
