Closed
[Requirement|需求建议]: 新增NonMaxSuppressionV7算子Ascend950实现 #810
wuxiyuanAdd on  Aug 25Closed at  Aug 25
wuxiyuan
wuxiyuanCollaborators
Aug 25 Create

背景

NonMaxSuppressionV7 是目标检测场景中的核心后处理算子,按 batch 和类别对候选框执行贪心非极大值抑制(NMS),输出被选中框的索引三元组。当前 ops-cv 仓库的 objdetect 分类下缺少该算子的 Ascend C 实现,需要补充以完善算子覆盖度。

需求描述

在 Ascend950 平台上实现 NonMaxSuppressionV7 算子,需包含:

  1. 算子原型与定义:REG_OP 注册 + OpDef 配置,支持 boxes/scores 的 FLOAT16/FLOAT32 四种 dtype 组合
  2. Infershape:校验 boxes [B,N,4] 与 scores [B,C,N] 维度约束,输出推导为 [max_boxes_size, 3],类型 INT32
  3. Tiling 策略:平台资源查询、可选标量输入校验、UB tile 尺寸与 workspace 布局计算、整数/空间溢出检查
  4. Kernel 实现:贪心选择 + IoU 抑制算法,含小规模标量路径与大规模 tile/向量路径
  5. 测试:Infershape UT、Tiling UT、CPU Golden 参考实现、GE IR 建图示例
  6. 文档:README.md 及 op_list.md 登记

输入输出规格

参数 类型 shape 说明
boxes 输入 [B, N, 4] FLOAT16/FLOAT32
scores 输入 [B, C, N] FLOAT16/FLOAT32
max_output_size 可选输入 标量或 (1,) INT32
iou_threshold 可选输入 标量或 (1,) FLOAT32,默认 0.0
score_threshold 可选输入 标量或 (1,) FLOAT32,默认 0.0
index_id 可选输入 [B, C, N, 3] 或 [B, C, N, 4] FLOAT16
selected_indices 输出 [max_boxes_size, 3] INT32,不足填充 (-1,-1,-1)

属性:center_point_box(0/1,默认 0)、max_boxes_size([0, INT32_MAX],默认 0)

验收标准

likedislike
wuxiyuanwuxiyuanCollaborators
Aug 25 Modify description of issue
sunhao_hwsunhao_hwCollaborators
Aug 25 Assign wuxiyuan as responsible person
CANN-robotCANN-robotCollaborators
Aug 25 Close issue
CANN-robotCANN-robotCollaborators
Aug 25 Added label: resolved