# ppdet

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

## Functions

### compute_pp_text_detections

```python
def compute_pp_text_detections(predictions: np.ndarray, *, mask_threshold: float, conf_threshold: float, max_det: int) -> tuple[np.ndarray, np.ndarray, np.ndarray]:
```

Decode PaddleOCR text regions into rotated boxes.

Parameters

 * `predictions` (`np.ndarray`): Text probability tensor accepted by `parse_paddle_detection_outputs`.
 * `mask_threshold` (`float`): Threshold used to binarize the text probability map.
 * `conf_threshold` (`float`): Minimum detection confidence used to filter candidates.
 * `max_det` (`int`): Maximum number of detection candidates to retain or consider during suppression.

Returns

 * `tuple[np.ndarray, np.ndarray, np.ndarray]`: Normalized center-XY/width/height boxes, rotation angles in degrees, and
   confidence scores.

### parse_paddle_detection_outputs

```python
def parse_paddle_detection_outputs(predictions: np.ndarray, mask_threshold: float = 0.25, bbox_threshold: float = 0.5, max_detections: int = 100, width: int | None = None, height: int | None = None) -> tuple[np.ndarray, np.ndarray, np.ndarray]:
```

Parse the output of a PaddlePaddle Text Detection model from a mask of text probabilities into rotated bounding boxes with
additional corners saved as keypoints.

Parameters

 * `predictions` (`np.ndarray`): The output of a PaddlePaddle Text Detection model.
 * `mask_threshold` (`float`): The threshold for the mask.
 * `bbox_threshold` (`float`): The threshold for bounding boxes.
 * `max_detections` (`int`): The maximum number of candidate bounding boxes.
 * `width` (`int | None`): The width of the image.
 * `height` (`int | None`): The height of the image.

Returns

 * `tuple[np.ndarray, np.ndarray, np.ndarray]`: A touple containing the rotated bounding boxes, corners and scores.
