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
OpenPCDet
Commits
35b68c92
Commit
35b68c92
authored
Jul 30, 2020
by
Shaoshuai Shi
Browse files
update VoxelGenerator to support spconv1.0 and spconv1.2
parent
4db49780
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
pcdet/datasets/processor/data_processor.py
pcdet/datasets/processor/data_processor.py
+12
-2
No files found.
pcdet/datasets/processor/data_processor.py
View file @
35b68c92
...
...
@@ -40,6 +40,9 @@ class DataProcessor(object):
def
transform_points_to_voxels
(
self
,
data_dict
=
None
,
config
=
None
,
voxel_generator
=
None
):
if
data_dict
is
None
:
try
:
from
spconv.utils
import
VoxelGeneratorV2
as
VoxelGenerator
except
:
from
spconv.utils
import
VoxelGenerator
voxel_generator
=
VoxelGenerator
(
...
...
@@ -52,8 +55,15 @@ class DataProcessor(object):
self
.
grid_size
=
np
.
round
(
grid_size
).
astype
(
np
.
int64
)
self
.
voxel_size
=
config
.
VOXEL_SIZE
return
partial
(
self
.
transform_points_to_voxels
,
voxel_generator
=
voxel_generator
)
points
=
data_dict
[
'points'
]
voxels
,
coordinates
,
num_points
=
voxel_generator
.
generate
(
points
)
voxel_output
=
voxel_generator
.
generate
(
points
)
if
isinstance
(
voxel_output
,
dict
):
voxels
,
coordinates
,
num_points
=
\
voxel_output
[
'voxels'
],
voxel_output
[
'coordinates'
],
voxel_output
[
'num_points_per_voxel'
]
else
:
voxels
,
coordinates
,
num_points
=
voxel_output
if
not
data_dict
[
'use_lead_xyz'
]:
voxels
=
voxels
[...,
3
:]
# remove xyz in voxels(N, 3)
...
...
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