# rf_detr

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

## 函数

### compute_rfdetr_detections

```python
def compute_rfdetr_detections(boxes_tensor: np.ndarray, logits_tensor: np.ndarray, *, conf_threshold: float, max_det: int, label_names: list[str] | None, mask_conf: float, input_shape: tuple[int, int] | None, masks_tensor: np.ndarray | None = None, logger=None) -> tuple[np.ndarray, np.ndarray, np.ndarray, list[str] | None, np.ndarray | None]:
```

解码 RF-DETR 检测和可选的实例掩码。

参数

 * `boxes_tensor` (`np.ndarray`): 批处理的归一化中心 XY/宽度/高度预测。
 * `logits_tensor` (`np.ndarray`): 形状为 `(1, queries, classes)` 的类别 logits。
 * `conf_threshold` (`float`): 用于过滤候选的最小检测置信度。
 * `max_det` (`int`): 在抑制期间保留或考虑的最大检测候选数。
 * `label_names` (`list[str] | None`): 按预测类别 ID 索引的可选类别名称查找。
 * `mask_conf` (`float`): 用于二值化掩码 logits 的概率阈值。
 * `input_shape` (`tuple[int, int] | None`): 模型输入图像形状，格式为 `(height, width)`。
 * `masks_tensor` (`np.ndarray | None`): 可选的每个查询掩码 logits，按边界框预测的顺序排列。
 * `logger`: 用于报告已丢弃分割实例的可选记录器。

返回

 * `tuple[np.ndarray, np.ndarray, np.ndarray, list[str] | None, np.ndarray | None]`: 归一化中心 XY/宽度/高度格式的边界框、分数、整数类别 ID、可选类别名称以及可选的
   HW uint8 实例掩码。掩码值索引返回的检测；255 是背景。分割最多保留 255 个实例，置信度更高的掩码会覆盖重叠部分。

引发

 * `ValueError`: 如果在没有 `input_shape` 的情况下请求掩码解码。
