# superanimal

Python API: `depthai_nodes.node.parsers.utils.superanimal`

## 函数

### compute_superanimal_keypoints

```python
def compute_superanimal_keypoints(heatmaps: np.ndarray, *, scale_factor: float) -> tuple[np.ndarray, np.ndarray]:
```

将 SuperAnimal 热图解码为归一化地标。

参数

 * `heatmaps` (`np.ndarray`): 模型热图张量。
 * `scale_factor` (`float`): 用于将模型坐标转换为归一化坐标的非零除数。

返回

 * `tuple[np.ndarray, np.ndarray]`: 一对 `(N, 2)` 关键点坐标和 `(N,)` 分数。坐标除以 `scale_factor`。

### get_pose_prediction

```python
def get_pose_prediction(heatmap, locref, scale_factors):
```

从热图和 locref 张量获取姿态预测。用于 SuperAnimal 模型。

参数

 * `heatmap` (`np.ndarray`): 热图张量。
 * `locref` (`np.ndarray`): Locref 张量。
 * `scale_factors` (`tuple[float, float]`): x 轴和 y 轴的比例因子。

返回

 * `np.ndarray`: 姿态预测。

### get_top_values

```python
def get_top_values(heatmap):
```

从热图张量中获取顶部值。

参数

 * `heatmap` (`np.ndarray`): 热图张量。

返回

 * `tuple[np.ndarray, np.ndarray]`: 顶部值的 Y 和 X 坐标。
