# keypoints

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

## 函数

### 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:
```

创建关键点，可选择置信度过滤和骨架边缘。

参数

 * `keypoints` (`np.ndarray | list[list[float]]`): 形状为 `(N, 2)` 或 `(N, 3)` 的点数组或列表。列表必须包含浮点坐标。值被复制，不进行缩放或裁剪；2D 点的 Z 坐标为 0。支持空输入。
 * `scores` (`np.ndarray | list[float] | None`): 可选的浮点置信度，范围为 [0, 1]，每个点一个。省略的分数将产生 -1 的置信度。
 * `confidence_threshold` (`float | None`): 可选的浮点数，范围为 [0, 1]。只有在提供分数时，低于此阈值的点才会被移除。
 * `label_names` (`list[str] | None`): 可选的字符串列表，其中每个保留的输入点都有一个条目。
 * `edges` (`list[tuple[int, int]] | None`): 可选的原始点索引对。与已移除或不存在的点相关的边缘将被丢弃，保留的索引将被重新映射。

返回

 * `dai.beta.Keypoints`: 包含保留的坐标、置信度、名称和边缘的本机关键点消息。

抛出

 * `ValueError`: 如果点、分数、阈值、名称或边缘未能通过类型、形状或值验证。
 * `IndexError`: 如果 `label_names` 没有为保留的输入点提供条目。
