Skip to content

Commit

Permalink
[Enhance] Confirm the input does not be changed in bg_point_filter un…
Browse files Browse the repository at this point in the history
…it test (#621)

* add unittest to confirm the input is not be modified

* assert gt_bboxes_3d

* rm .swag

* modify np.allclose to np.equal

* fix error tap

* fix np.equal() error
  • Loading branch information
xiliu8006 authored Jul 1, 2021
1 parent ed090ed commit 57e470a
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,7 @@ def test_background_points_filter():
points = np.concatenate([points, extra_points.numpy()], 0)
points = LiDARPoints(points, points_dim=4)
input_dict = dict(points=points, gt_bboxes_3d=gt_bboxes_3d)
origin_gt_bboxes_3d = gt_bboxes_3d.clone()
input_dict = background_points_filter(input_dict)

points = input_dict['points'].tensor.numpy()
Expand All @@ -622,7 +623,9 @@ def test_background_points_filter():
'[[0.5, 2.0, 0.5]])'
assert repr_str == expected_repr_str
assert points.shape == (800, 4)
assert np.allclose(orig_points, points)
assert np.equal(orig_points, points).all()
assert np.equal(input_dict['gt_bboxes_3d'].tensor.numpy(),
origin_gt_bboxes_3d.tensor.numpy()).all()

# test single float config
BackgroundPointsFilter(0.5)
Expand Down

0 comments on commit 57e470a

Please sign in to comment.