Unverified Commit 807da147 authored by Zongbao Feng's avatar Zongbao Feng Committed by GitHub
Browse files

Update test_voxel_generator.py (#919)

parent e464b9ea
......@@ -12,12 +12,11 @@ def test_voxel_generator():
self = VoxelGenerator(voxel_size, point_cloud_range, max_num_points)
points = np.random.rand(1000, 4)
voxels = self.generate(points)
coors, voxels, num_points_per_voxel = voxels
expected_voxels = np.array([[7, 81, 1], [6, 81, 0], [7, 80, 1], [6, 81, 1],
[7, 81, 0], [6, 80, 1], [7, 80, 0], [6, 80,
0]])
voxels, coors, num_points_per_voxel = voxels
expected_coors = np.array([[7, 81, 1], [6, 81, 0], [7, 80, 1], [6, 81, 1],
[7, 81, 0], [6, 80, 1], [7, 80, 0], [6, 80, 0]])
expected_num_points_per_voxel = np.array(
[120, 121, 127, 134, 115, 127, 125, 131])
assert np.all(voxels == expected_voxels)
assert coors.shape == (8, 1000, 4)
assert voxels.shape == (8, 1000, 4)
assert np.all(coors == expected_coors)
assert np.all(num_points_per_voxel == expected_num_points_per_voxel)
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