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
ac5198a7
Commit
ac5198a7
authored
Jan 05, 2022
by
Shaoshuai Shi
Browse files
move max_sweeps filter to PointFeatureEncoder with new config FILTER_SWEEPS
parent
38c89dd6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
pcdet/datasets/dataset.py
pcdet/datasets/dataset.py
+0
-9
pcdet/datasets/processor/point_feature_encoder.py
pcdet/datasets/processor/point_feature_encoder.py
+9
-0
No files found.
pcdet/datasets/dataset.py
View file @
ac5198a7
...
...
@@ -142,15 +142,6 @@ class DatasetTemplate(torch_data.Dataset):
if
data_dict
.
get
(
'gt_boxes2d'
,
None
)
is
not
None
:
data_dict
[
'gt_boxes2d'
]
=
data_dict
[
'gt_boxes2d'
][
selected
]
if
'timestamp'
in
self
.
dataset_cfg
.
POINT_FEATURE_ENCODING
.
get
(
'src_feature_list'
):
if
data_dict
.
get
(
'points'
,
None
)
is
not
None
:
max_sweeps
=
self
.
dataset_cfg
.
get
(
'MAX_SWEEPS'
,
1
)
idx
=
self
.
dataset_cfg
.
POINT_FEATURE_ENCODING
.
get
(
'src_feature_list'
).
index
(
'timestamp'
)
dt
=
np
.
round
(
data_dict
[
'points'
][:,
idx
],
2
)
if
np
.
unique
(
dt
).
shape
[
0
]
==
max_sweeps
:
max_dt
=
sorted
(
np
.
unique
(
dt
))[
max_sweeps
-
1
]
data_dict
[
'points'
]
=
data_dict
[
'points'
][
dt
<=
max_dt
]
if
data_dict
.
get
(
'points'
,
None
)
is
not
None
:
data_dict
=
self
.
point_feature_encoder
.
forward
(
data_dict
)
...
...
pcdet/datasets/processor/point_feature_encoder.py
View file @
ac5198a7
...
...
@@ -30,6 +30,14 @@ class PointFeatureEncoder(object):
data_dict
[
'points'
]
)
data_dict
[
'use_lead_xyz'
]
=
use_lead_xyz
if
self
.
point_encoding_config
.
get
(
'FILTER_SWEEPS'
,
False
)
and
'timestamp'
in
self
.
src_feature_list
:
max_sweeps
=
self
.
point_encoding_config
.
MAX_SWEEPS
idx
=
self
.
src_feature_list
.
index
(
'timestamp'
)
dt
=
np
.
round
(
data_dict
[
'points'
][:,
idx
],
2
)
max_dt
=
sorted
(
np
.
unique
(
dt
))[
min
(
len
(
np
.
unique
(
dt
))
-
1
,
max_sweeps
-
1
)]
data_dict
[
'points'
]
=
data_dict
[
'points'
][
dt
<=
max_dt
]
return
data_dict
def
absolute_coordinates_encoding
(
self
,
points
=
None
):
...
...
@@ -44,4 +52,5 @@ class PointFeatureEncoder(object):
idx
=
self
.
src_feature_list
.
index
(
x
)
point_feature_list
.
append
(
points
[:,
idx
:
idx
+
1
])
point_features
=
np
.
concatenate
(
point_feature_list
,
axis
=
1
)
return
point_features
,
True
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