mirror of https://github.com/open-mmlab/mmcv.git
[Fix] Add missing contiguous calls for nms_rotated (#2547)
Addresses issue https://github.com/open-mmlab/mmcv/issues/2542 For nms_rotated_cuda only adds contiguous call to dets_sorted which is accessed directly. For nms_rotated_cpu the implementation now matches what's in the detectron2 repo.pull/2579/head
parent
87768b7f2d
commit
497c2df495
|
@ -26,8 +26,8 @@ Tensor nms_rotated(const Tensor dets, const Tensor scores, const Tensor order,
|
|||
assert(dets.device().is_cuda() == scores.device().is_cuda());
|
||||
if (dets.device().is_cuda()) {
|
||||
#ifdef MMCV_WITH_CUDA
|
||||
return nms_rotated_cuda(dets, scores, order, dets_sorted, iou_threshold,
|
||||
multi_label);
|
||||
return nms_rotated_cuda(dets, scores, order, dets_sorted.contiguous(),
|
||||
iou_threshold, multi_label);
|
||||
#else
|
||||
AT_ERROR("Not compiled with GPU support");
|
||||
#endif
|
||||
|
@ -39,5 +39,5 @@ Tensor nms_rotated(const Tensor dets, const Tensor scores, const Tensor order,
|
|||
#endif
|
||||
}
|
||||
|
||||
return nms_rotated_cpu(dets, scores, iou_threshold);
|
||||
return nms_rotated_cpu(dets.contiguous(), scores.contiguous(), iou_threshold);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue