"git@developer.sourcefind.cn:change/sglang.git" did not exist on "760b788a58a826c0bc365f58b68ef22206bf02f0"
Commit 26c08c7e authored by zhangwenwei's avatar zhangwenwei
Browse files

Merge branch 'fix-nus-box-bug' into 'master'

fix bug of label index in nus bbox

See merge request open-mmlab/mmdet.3d!62
parents 47850641 2ca5279b
......@@ -304,7 +304,11 @@ class ObjectRangeFilter(object):
gt_labels_3d = input_dict['gt_labels_3d']
mask = gt_bboxes_3d.in_range_bev(self.bev_range)
gt_bboxes_3d = gt_bboxes_3d[mask]
gt_labels_3d = gt_labels_3d[mask]
# mask is a torch tensor but gt_labels_3d is still numpy array
# using mask to index gt_labels_3d will cause bug when
# len(gt_labels_3d) == 1, where mask=1 will be interpreted
# as gt_labels_3d[1] and cause out of index error
gt_labels_3d = gt_labels_3d[mask.numpy().astype(np.bool)]
# limit rad to [-pi, pi]
gt_bboxes_3d.limit_yaw(offset=0.5, period=2 * np.pi)
......
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