此页面由 AI 自动翻译。查看英文原版
最后更新

本页目录

  • 函数
  • compute_pp_text_detections
  • parse_paddle_detection_outputs
Claude CodeCodexCursor
Luxonis 智能体工具包为你常用的编程智能体加载 Luxonis 上下文与技能,更快地基于 OAK 开发应用。
安装工具包
最后更新
Python API: depthai_nodes.node.parsers.utils.ppdet

函数

compute_pp_text_detections

Python
1def compute_pp_text_detections(predictions: np.ndarray, *, mask_threshold: float, conf_threshold: float, max_det: int) -> tuple[np.ndarray, np.ndarray, np.ndarray]:
将 PaddleOCR 文本区域解码为旋转框。参数
  • predictions (np.ndarray): parse_paddle_detection_outputs 接受的文本概率张量。
  • mask_threshold (float): 用于二值化文本概率图的阈值。
  • conf_threshold (float): 用于过滤候选的最小检测置信度。
  • max_det (int): 在抑制期间保留或考虑的最大检测候选数。
返回
  • tuple[np.ndarray, np.ndarray, np.ndarray]: 归一化的中心-XY/宽度/高度框、旋转角度(度)和置信度分数。

parse_paddle_detection_outputs

Python
1def 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]:
将 PaddlePaddle 文本检测模型的输出从文本概率掩码解析为带有额外角点(保存为关键点)的旋转边界框。参数
  • predictions (np.ndarray): PaddlePaddle 文本检测模型的输出。
  • mask_threshold (float): 掩码的阈值。
  • bbox_threshold (float): 边界框的阈值。
  • max_detections (int): 候选边界框的最大数量。
  • width (int | None): 图像的宽度。
  • height (int | None): 图像的高度。
返回
  • tuple[np.ndarray, np.ndarray, np.ndarray]: 包含旋转边界框、角点和分数的元组。