From 859a2cc4babcbe393e66bdd67620749239483ff0 Mon Sep 17 00:00:00 2001 From: momo609 <963372609@qq.com> Date: Mon, 17 Jun 2024 16:24:35 +0800 Subject: [PATCH] fix pointsinbox bug --- mmcv/ops/points_in_boxes.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mmcv/ops/points_in_boxes.py b/mmcv/ops/points_in_boxes.py index 94c8dad33e..23c35da4eb 100644 --- a/mmcv/ops/points_in_boxes.py +++ b/mmcv/ops/points_in_boxes.py @@ -50,6 +50,8 @@ def points_in_boxes_part(points: Tensor, boxes: Tensor) -> Tensor: if points.device.type != 'npu': if torch.cuda.current_device() != points_device: torch.cuda.set_device(points_device) + elif points.device.type == 'npu': + boxes[:, :, 2] += boxes[:, :, 5] / 2.0 ext_module.points_in_boxes_part_forward(boxes.contiguous(), points.contiguous(),