# rf_detr

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

## Functions

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

Decode RF-DETR detections and optional instance masks.

Parameters

 * `boxes_tensor` (`np.ndarray`): Batched normalized center-XY/width/height predictions.
 * `logits_tensor` (`np.ndarray`): Class logits of shape `(1, queries, classes)`.
 * `conf_threshold` (`float`): Minimum detection confidence used to filter candidates.
 * `max_det` (`int`): Maximum number of detection candidates to retain or consider during suppression.
 * `label_names` (`list[str] | None`): Optional class-name lookup indexed by predicted class ID.
 * `mask_conf` (`float`): Probability threshold used to binarize mask logits.
 * `input_shape` (`tuple[int, int] | None`): Model input image shape as `(height, width)`.
 * `masks_tensor` (`np.ndarray | None`): Optional per-query mask logits, ordered like the box predictions.
 * `logger`: Optional logger used to report discarded segmentation instances.

Returns

 * `tuple[np.ndarray, np.ndarray, np.ndarray, list[str] | None, np.ndarray | None]`: Boxes in normalized center-XY/width/height
   format, scores, integer class IDs, optional class names, and an optional HW uint8 instance mask. Mask values index returned
   detections; 255 is background. Segmentation retains at most 255 instances, and higher-confidence masks win overlaps.

Raises

 * `ValueError`: If mask decoding is requested without `input_shape`.
