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
mmdetection3d
Commits
7438a47c
Unverified
Commit
7438a47c
authored
Mar 22, 2022
by
Wenhao Wu
Committed by
GitHub
Mar 22, 2022
Browse files
[Fix] Remove PointSample constraint (#1314)
* remove the constraint of PointSample with distance * rename variable
parent
1f906cff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
9 deletions
+3
-9
mmdet3d/datasets/pipelines/transforms_3d.py
mmdet3d/datasets/pipelines/transforms_3d.py
+3
-9
No files found.
mmdet3d/datasets/pipelines/transforms_3d.py
View file @
7438a47c
...
...
@@ -907,9 +907,9 @@ class PointSample(object):
point_range
=
range
(
len
(
points
))
if
sample_range
is
not
None
and
not
replace
:
# Only sampling the near points when len(points) >= num_samples
d
epth
=
np
.
linalg
.
norm
(
points
.
tensor
,
axis
=
1
)
far_inds
=
np
.
where
(
d
epth
>=
sample_range
)[
0
]
near_inds
=
np
.
where
(
d
epth
<
sample_range
)[
0
]
d
ist
=
np
.
linalg
.
norm
(
points
.
tensor
,
axis
=
1
)
far_inds
=
np
.
where
(
d
ist
>=
sample_range
)[
0
]
near_inds
=
np
.
where
(
d
ist
<
sample_range
)[
0
]
# in case there are too many far points
if
len
(
far_inds
)
>
num_samples
:
far_inds
=
np
.
random
.
choice
(
...
...
@@ -936,12 +936,6 @@ class PointSample(object):
and 'pts_semantic_mask' keys are updated in the result dict.
"""
points
=
results
[
'points'
]
# Points in Camera coord can provide the depth information.
# TODO: Need to support distance-based sampling for other coord system.
if
self
.
sample_range
is
not
None
:
from
mmdet3d.core.points
import
CameraPoints
assert
isinstance
(
points
,
CameraPoints
),
\
'Sampling based on distance is only applicable for CAM coord'
points
,
choices
=
self
.
_points_random_sampling
(
points
,
self
.
num_points
,
...
...
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