[Fix] nms_rotated_npu accepts angle parameter (#2670)

pull/2712/head
NoCakeAnyMore 2023-03-17 16:40:01 +08:00 committed by GitHub
parent 75290685b7
commit a3e97360a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -460,6 +460,9 @@ def nms_rotated(dets: Tensor,
input_labels = labels
if dets.device.type == 'npu':
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,
input_labels, iou_threshold,
multi_label)