Skip to content

Commit

Permalink
[Fix] Add missing contiguous calls for nms_rotated (open-mmlab#2547)
Browse files Browse the repository at this point in the history
Addresses issue open-mmlab#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.
  • Loading branch information
allanzelener authored and CokeDong committed Apr 6, 2023
1 parent 0bb605b commit 48dbae4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mmcv/ops/csrc/pytorch/nms_rotated.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
}

0 comments on commit 48dbae4

Please sign in to comment.