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
505468d1
Commit
505468d1
authored
Jul 03, 2020
by
Shaoshuai Shi
Browse files
bugfixed: lidar_path ==> str(lidar_path), speed up create_groundtruth_database of nuscenes
parent
45ffca47
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
pcdet/datasets/nuscenes/nuscenes_dataset.py
pcdet/datasets/nuscenes/nuscenes_dataset.py
+7
-6
tools/cfgs/dataset_configs/nuscenes_dataset.yaml
tools/cfgs/dataset_configs/nuscenes_dataset.yaml
+1
-1
No files found.
pcdet/datasets/nuscenes/nuscenes_dataset.py
View file @
505468d1
...
...
@@ -37,7 +37,7 @@ class NuScenesDataset(DatasetTemplate):
return
points
[
mask
]
lidar_path
=
self
.
root_path
/
sweep_info
[
'lidar_path'
]
points_sweep
=
np
.
fromfile
(
lidar_path
,
dtype
=
np
.
float32
,
count
=-
1
).
reshape
([
-
1
,
5
])[:,
:
4
]
points_sweep
=
np
.
fromfile
(
str
(
lidar_path
)
,
dtype
=
np
.
float32
,
count
=-
1
).
reshape
([
-
1
,
5
])[:,
:
4
]
points_sweep
=
remove_ego_points
(
points_sweep
).
T
if
sweep_info
[
'transform_matrix'
]
is
not
None
:
num_points
=
points_sweep
.
shape
[
1
]
...
...
@@ -50,7 +50,7 @@ class NuScenesDataset(DatasetTemplate):
def
get_lidar_with_sweeps
(
self
,
index
,
max_sweeps
=
1
):
info
=
self
.
infos
[
index
]
lidar_path
=
self
.
root_path
/
info
[
'lidar_path'
]
points
=
np
.
fromfile
(
lidar_path
,
dtype
=
np
.
float32
,
count
=-
1
).
reshape
([
-
1
,
5
])[:,
:
4
]
points
=
np
.
fromfile
(
str
(
lidar_path
)
,
dtype
=
np
.
float32
,
count
=-
1
).
reshape
([
-
1
,
5
])[:,
:
4
]
sweep_points_list
=
[
points
]
sweep_times_list
=
[
np
.
zeros
((
points
.
shape
[
0
],
1
))]
...
...
@@ -107,14 +107,15 @@ class NuScenesDataset(DatasetTemplate):
gt_boxes
=
info
[
'gt_boxes'
]
gt_names
=
info
[
'gt_names'
]
point_indices
=
roiaware_pool3d_utils
.
points_in_boxes_cpu
(
torch
.
from_numpy
(
points
[:,
0
:
3
]),
torch
.
from_numpy
(
gt_boxes
[:,
0
:
7
])
).
numpy
()
# (nboxes, npoints)
box_idxs_of_pts
=
roiaware_pool3d_utils
.
points_in_boxes_gpu
(
torch
.
from_numpy
(
points
[:,
0
:
3
]).
unsqueeze
(
dim
=
0
).
float
().
cuda
(),
torch
.
from_numpy
(
gt_boxes
[:,
0
:
7
]).
unsqueeze
(
dim
=
0
).
float
().
cuda
()
).
long
().
squeeze
(
dim
=
0
).
cpu
().
numpy
()
for
i
in
range
(
gt_boxes
.
shape
[
0
]):
filename
=
'%s_%s_%d.bin'
%
(
sample_idx
,
gt_names
[
i
],
i
)
filepath
=
database_save_path
/
filename
gt_points
=
points
[
point_indices
[
i
]
>
0
]
gt_points
=
points
[
box_idxs_of_pts
==
i
]
gt_points
[:,
:
3
]
-=
gt_boxes
[
i
,
:
3
]
with
open
(
filepath
,
'w'
)
as
f
:
...
...
tools/cfgs/dataset_configs/nuscenes_dataset.yaml
View file @
505468d1
DATASET
:
'
NuScenesDataset'
DATA_PATH
:
'
../data/nuscenes'
VERSION
:
'
v1.0-
mini
'
VERSION
:
'
v1.0-
trainval
'
MAX_SWEEPS
:
10
PRED_VELOCITY
:
False
...
...
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