Thanks for sending an requirement! Please fill in the following template to help quickly solve your problem.
旋转目标检测(Rotated Object Detection,如遥感图像、场景文字、无人机航拍等场景)在网络推理阶段会输出相对于预设锚框(anchor)的偏移量 deltas,需要通过旋转框解码算子将其还原为最终的旋转检测框。当前 ops-cv 仓库在 Ascend 950(arch35)上缺少该算子实现,导致基于旋转框的检测模型在 Ascend 950 上无法端到端部署,需退化为 host 侧软件计算,存在性能与精度风险。
deltas
NA
为 Ascend 950 新增 RotatedBoxDecode 算子,完成完整开发链路:
RotatedBoxDecode
OpDef
FORMAT_ND
IMPL_OP_INFERSHAPE
COMMON_INFER_FUNC_REG
InferDataType
输入 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 一致。
anchor_box (B, 5, N)
[lx, ly, rx, ry, angle]
deltas (B, 5, N)
[dx, dy, dw, dh, dt]
weight [wx, wy, ww, wh, wt]
y (B, 5, N)
anchor_box
计算步骤:
(lx, ly, rx, ry)
(cx, cy, w, h)
t_cx = a_cx + Δx·a_w
t_cy = a_cy + Δy·a_h
t_w = exp(Δw)·a_w
t_h = exp(Δh)·a_h
θ_t = atan(tan(θ_a) + Δt)
(lx', ly', rx', ry')
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)IMPL_OP_INFERSHAPE+ V1COMMON_INFER_FUNC_REG双路径,以及InferDataType)算子语义
输入
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一致。计算步骤:
(lx, ly, rx, ry)算(cx, cy, w, h),宽高夹下限 1t_cx = a_cx + Δx·a_w,t_cy = a_cy + Δy·a_ht_w = exp(Δw)·a_w,t_h = exp(Δh)·a_hθ_t = atan(tan(θ_a) + Δt)(度↔弧度转换,tan 空间加法抗 180° 周期)(cx, cy, w, h)还原(lx', ly', rx', ry'),角度透传