Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
mmdetection3d
Commits
807da147
Unverified
Commit
807da147
authored
Sep 15, 2021
by
Zongbao Feng
Committed by
GitHub
Sep 15, 2021
Browse files
Update test_voxel_generator.py (#919)
parent
e464b9ea
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
tests/test_models/test_voxel_encoder/test_voxel_generator.py
tests/test_models/test_voxel_encoder/test_voxel_generator.py
+5
-6
No files found.
tests/test_models/test_voxel_encoder/test_voxel_generator.py
View file @
807da147
...
@@ -12,12 +12,11 @@ def test_voxel_generator():
...
@@ -12,12 +12,11 @@ def test_voxel_generator():
self
=
VoxelGenerator
(
voxel_size
,
point_cloud_range
,
max_num_points
)
self
=
VoxelGenerator
(
voxel_size
,
point_cloud_range
,
max_num_points
)
points
=
np
.
random
.
rand
(
1000
,
4
)
points
=
np
.
random
.
rand
(
1000
,
4
)
voxels
=
self
.
generate
(
points
)
voxels
=
self
.
generate
(
points
)
coors
,
voxels
,
num_points_per_voxel
=
voxels
voxels
,
coors
,
num_points_per_voxel
=
voxels
expected_voxels
=
np
.
array
([[
7
,
81
,
1
],
[
6
,
81
,
0
],
[
7
,
80
,
1
],
[
6
,
81
,
1
],
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
,
[
7
,
81
,
0
],
[
6
,
80
,
1
],
[
7
,
80
,
0
],
[
6
,
80
,
0
]])
0
]])
expected_num_points_per_voxel
=
np
.
array
(
expected_num_points_per_voxel
=
np
.
array
(
[
120
,
121
,
127
,
134
,
115
,
127
,
125
,
131
])
[
120
,
121
,
127
,
134
,
115
,
127
,
125
,
131
])
assert
np
.
all
(
voxels
==
expected_voxels
)
assert
voxels
.
shape
==
(
8
,
1000
,
4
)
assert
coors
.
shape
==
(
8
,
1000
,
4
)
assert
np
.
all
(
coors
==
expected_coors
)
assert
np
.
all
(
num_points_per_voxel
==
expected_num_points_per_voxel
)
assert
np
.
all
(
num_points_per_voxel
==
expected_num_points_per_voxel
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment