Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
one
spconv
Commits
5df97387
Commit
5df97387
authored
May 07, 2019
by
traveller59
Browse files
fix a bug
parent
d6310a27
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
spconv/utils/__init__.py
spconv/utils/__init__.py
+5
-3
No files found.
spconv/utils/__init__.py
View file @
5df97387
...
@@ -222,10 +222,13 @@ class VoxelGeneratorV2:
...
@@ -222,10 +222,13 @@ class VoxelGeneratorV2:
grid_size
=
(
grid_size
=
(
point_cloud_range
[
3
:]
-
point_cloud_range
[:
3
])
/
voxel_size
point_cloud_range
[
3
:]
-
point_cloud_range
[:
3
])
/
voxel_size
grid_size
=
np
.
round
(
grid_size
).
astype
(
np
.
int64
)
grid_size
=
np
.
round
(
grid_size
).
astype
(
np
.
int64
)
if
block_filtering
:
assert
block_size
>
0
assert
grid_size
[
0
]
%
block_factor
==
0
assert
grid_size
[
1
]
%
block_factor
==
0
voxelmap_shape
=
tuple
(
np
.
round
(
grid_size
).
astype
(
np
.
int32
).
tolist
())
voxelmap_shape
=
tuple
(
np
.
round
(
grid_size
).
astype
(
np
.
int32
).
tolist
())
voxelmap_shape
=
voxelmap_shape
[::
-
1
]
voxelmap_shape
=
voxelmap_shape
[::
-
1
]
assert
grid_size
[
0
]
%
block_factor
==
0
assert
grid_size
[
1
]
%
block_factor
==
0
self
.
_coor_to_voxelidx
=
np
.
full
(
voxelmap_shape
,
-
1
,
dtype
=
np
.
int32
)
self
.
_coor_to_voxelidx
=
np
.
full
(
voxelmap_shape
,
-
1
,
dtype
=
np
.
int32
)
self
.
_voxel_size
=
voxel_size
self
.
_voxel_size
=
voxel_size
self
.
_point_cloud_range
=
point_cloud_range
self
.
_point_cloud_range
=
point_cloud_range
...
@@ -238,7 +241,6 @@ class VoxelGeneratorV2:
...
@@ -238,7 +241,6 @@ class VoxelGeneratorV2:
self
.
_block_factor
=
block_factor
self
.
_block_factor
=
block_factor
self
.
_height_threshold
=
height_threshold
self
.
_height_threshold
=
height_threshold
self
.
_block_size
=
block_size
self
.
_block_size
=
block_size
assert
block_size
>
0
def
generate
(
self
,
points
,
max_voxels
=
None
):
def
generate
(
self
,
points
,
max_voxels
=
None
):
res
=
points_to_voxel
(
res
=
points_to_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