Unverified Commit d31b2212 authored by NoCakeAnyMore's avatar NoCakeAnyMore Committed by GitHub
Browse files

[Fix] nms_rotated_npu accepts angle parameter (#2674)

parent 03ea1c9d
...@@ -412,6 +412,9 @@ def nms_rotated(dets: Tensor, ...@@ -412,6 +412,9 @@ def nms_rotated(dets: Tensor,
input_labels = labels input_labels = labels
if dets.device.type == 'npu': if dets.device.type == 'npu':
order = scores.new_empty(0, dtype=torch.long) order = scores.new_empty(0, dtype=torch.long)
coefficient = 57.29578 # 180 / PI
for i in range(dets.size()[0]):
dets_cw[i][4] *= coefficient # radians to angle
keep_inds = ext_module.nms_rotated(dets_cw, scores, order, dets_cw, keep_inds = ext_module.nms_rotated(dets_cw, scores, order, dets_cw,
input_labels, iou_threshold, input_labels, iou_threshold,
multi_label) multi_label)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment