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
07419768
Unverified
Commit
07419768
authored
Aug 07, 2020
by
ltphy
Committed by
GitHub
Aug 07, 2020
Browse files
fix sampling points (#218)
parent
96a60920
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
pcdet/datasets/processor/data_processor.py
pcdet/datasets/processor/data_processor.py
+8
-3
No files found.
pcdet/datasets/processor/data_processor.py
View file @
07419768
...
...
@@ -89,9 +89,14 @@ class DataProcessor(object):
far_idxs_choice
=
np
.
where
(
pts_near_flag
==
0
)[
0
]
near_idxs
=
np
.
where
(
pts_near_flag
==
1
)[
0
]
near_idxs_choice
=
np
.
random
.
choice
(
near_idxs
,
num_points
-
len
(
far_idxs_choice
),
replace
=
False
)
choice
=
[]
if
num_points
>
len
(
far_idxs_choice
):
near_idxs_choice
=
np
.
random
.
choice
(
near_idxs
,
num_points
-
len
(
far_idxs_choice
),
replace
=
False
)
choice
=
np
.
concatenate
((
near_idxs_choice
,
far_idxs_choice
),
axis
=
0
)
\
if
len
(
far_idxs_choice
)
>
0
else
near_idxs_choice
else
:
choice
=
np
.
arange
(
0
,
len
(
points
),
dtype
=
np
.
int32
)
choice
=
np
.
random
.
choice
(
choice
,
num_points
,
replace
=
False
)
np
.
random
.
shuffle
(
choice
)
else
:
choice
=
np
.
arange
(
0
,
len
(
points
),
dtype
=
np
.
int32
)
...
...
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