已关闭
[Requirement|需求建议]: ascend950 支持 rotated_box_decode #788
zhoulong50创建于  8月22日关闭于  8月25日
zhoulong50成员
8月22日 创建

Thanks for sending an requirement! Please fill in the following template to help quickly solve your problem.

Backgroud(背景信息)

旋转目标检测(Rotated Object Detection,如遥感图像、场景文字、无人机航拍等场景)在网络推理阶段会输出相对于预设锚框(anchor)的偏移量 deltas,需要通过旋转框解码算子将其还原为最终的旋转检测框。当前 ops-cv 仓库在 Ascend 950(arch35)上缺少该算子实现,导致基于旋转框的检测模型在 Ascend 950 上无法端到端部署,需退化为 host 侧软件计算,存在性能与精度风险。

Origin(信息来源)

NA

Benefit / Necessity (价值/作用)

Design(设计方案)

需求描述

为 Ascend 950 新增 RotatedBoxDecode 算子,完成完整开发链路:

  • 算子定义与注册(OpDef,支持动态 shape/rank、FP16/FP32、FORMAT_ND)
  • 图编译期 shape/dtype 推断(V2 IMPL_OP_INFERSHAPE + V1 COMMON_INFER_FUNC_REG 双路径,以及 InferDataType)
  • 主机侧 tiling(输入校验、N 轴/B 轴自适应多核切分、UB 256B 对齐)
  • 设备侧 kernel(三段式 CopyIn→Compute→CopyOut 流水、P=2 ping-pong、VF 融合计算链、exp/tan/atan 超越函数)
  • 测试与示例(torch golden 参考实现、tiling 单测、GE IR 建图运行示例)

算子语义

输入 anchor_box (B, 5, N)(5 = [lx, ly, rx, ry, angle],角度单位为度)与 deltas (B, 5, N)(5 = [dx, dy, dw, dh, dt]),可选属性 weight [wx, wy, ww, wh, wt](默认全 1)。输出 y (B, 5, N) 为解码后的旋转框,shape/dtype 与 anchor_box 一致。

计算步骤:

  1. 锚框角点转中心:由 (lx, ly, rx, ry) 算 (cx, cy, w, h),宽高夹下限 1
  2. delta 归一化:deltas 五通道分别除以 weight
  3. 解中心:t_cx = a_cx + Δx·a_w,t_cy = a_cy + Δy·a_h
  4. 解宽高:t_w = exp(Δw)·a_w,t_h = exp(Δh)·a_h
  5. 解角度:θ_t = atan(tan(θ_a) + Δt)(度↔弧度转换,tan 空间加法抗 180° 周期)
  6. 中心转角点:由 (cx, cy, w, h) 还原 (lx', ly', rx', ry'),角度透传
likedislike
Rrenruhai成员
8月22日 将 zhoulong50_hw 设为负责人
CANN-robotCANN-robot成员
8月25日 关闭了 issue
CANN-robotCANN-robot成员
8月25日 添加了label:resolved