Unverified Commit 648623bb authored by Ziyi Wu's avatar Ziyi Wu Committed by GitHub
Browse files

[Fix] Fix bug in `BackgroundPointsFilter` (#760)

* set gravity center origin

* remove filter transform in 3DSSD cfg
parent 8ac21990
......@@ -50,7 +50,8 @@ train_pipeline = [
type='GlobalRotScaleTrans',
rot_range=[-0.78539816, 0.78539816],
scale_ratio_range=[0.9, 1.1]),
dict(type='BackgroundPointsFilter', bbox_enlarge_range=(0.5, 2.0, 0.5)),
# 3DSSD can get a higher performance without this transform
# dict(type='BackgroundPointsFilter', bbox_enlarge_range=(0.5, 2.0, 0.5)),
dict(type='IndoorPointSample', num_points=16384),
dict(type='DefaultFormatBundle3D', class_names=class_names),
dict(type='Collect3D', keys=['points', 'gt_bboxes_3d', 'gt_labels_3d'])
......
......@@ -1194,10 +1194,10 @@ class BackgroundPointsFilter(object):
enlarged_gt_bboxes_3d = gt_bboxes_3d_np.copy()
enlarged_gt_bboxes_3d[:, 3:6] += self.bbox_enlarge_range
points_numpy = points.tensor.clone().numpy()
foreground_masks = box_np_ops.points_in_rbbox(points_numpy,
gt_bboxes_3d_np)
foreground_masks = box_np_ops.points_in_rbbox(
points_numpy, gt_bboxes_3d_np, origin=(0.5, 0.5, 0.5))
enlarge_foreground_masks = box_np_ops.points_in_rbbox(
points_numpy, enlarged_gt_bboxes_3d)
points_numpy, enlarged_gt_bboxes_3d, origin=(0.5, 0.5, 0.5))
foreground_masks = foreground_masks.max(1)
enlarge_foreground_masks = enlarge_foreground_masks.max(1)
valid_masks = ~np.logical_and(~foreground_masks,
......
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