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
fcb05070
"git@developer.sourcefind.cn:OpenDAS/nerfacc.git" did not exist on "d858e9f3a6814d04d298c561f65469b05689047e"
Commit
fcb05070
authored
May 08, 2020
by
liyinhao
Browse files
change flip and docstring
parent
a4a7bb49
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
10 deletions
+20
-10
mmdet3d/datasets/pipelines/indoor_augment.py
mmdet3d/datasets/pipelines/indoor_augment.py
+20
-10
No files found.
mmdet3d/datasets/pipelines/indoor_augment.py
View file @
fcb05070
...
...
@@ -7,32 +7,40 @@ from mmdet.datasets.builder import PIPELINES
class
IndoorFlipData
(
object
):
"""Indoor Flip Data.
Flip point_cloud and groundtruth boxes.
Flip point cloud and ground truth boxes.
The point cloud will ve flipped along the yz plane
and the xz plane with a certain probability.
Args:
flip_ratio (float): Probability of being flipped.
flip_ratio_yz (float): Probability of being flipped along yz plane.
Default: 0.5.
flip_ratio_xz (float): Probability of being flipped along xz plane.
Default: 0.5.
"""
def
__init__
(
self
,
flip_ratio
=
0.5
):
self
.
flip_ratio
=
flip_ratio
def
__init__
(
self
,
flip_ratio_yz
=
0.5
,
flip_ratio_xz
=
0.5
):
self
.
flip_ratio_yz
=
flip_ratio_yz
self
.
flip_ratio_xz
=
flip_ratio_xz
def
__call__
(
self
,
results
):
points
=
results
[
'points'
]
gt_bboxes_3d
=
results
[
'gt_bboxes_3d'
]
name
=
'scannet'
if
gt_bboxes_3d
.
shape
[
1
]
==
6
else
'sunrgbd'
if
np
.
random
.
random
()
>
self
.
flip_ratio
:
aligned
=
True
if
gt_bboxes_3d
.
shape
[
1
]
==
6
else
False
if
np
.
random
.
random
()
>
self
.
flip_ratio
_yz
:
# Flipping along the YZ plane
points
[:,
0
]
=
-
1
*
points
[:,
0
]
gt_bboxes_3d
[:,
0
]
=
-
1
*
gt_bboxes_3d
[:,
0
]
if
n
ame
==
'sunrgbd'
:
if
n
ot
aligned
:
gt_bboxes_3d
[:,
6
]
=
np
.
pi
-
gt_bboxes_3d
[:,
6
]
results
[
'flip'
]
=
True
results
[
'gt_boxes'
]
=
gt_bboxes_3d
if
name
==
'scannet'
and
np
.
random
.
random
()
>
0.5
:
if
aligned
and
np
.
random
.
random
()
>
self
.
flip_ratio_xz
:
# Flipping along the XZ plane
points
[:,
1
]
=
-
1
*
points
[:,
1
]
gt_bboxes_3d
[:,
1
]
=
-
1
*
gt_bboxes_3d
[:,
1
]
results
[
'flip'
]
=
True
results
[
'gt_bboxes_3d'
]
=
gt_bboxes_3d
results
[
'points'
]
=
points
...
...
@@ -40,7 +48,8 @@ class IndoorFlipData(object):
def
__repr__
(
self
):
repr_str
=
self
.
__class__
.
__name__
repr_str
+=
'(flip_ratio={})'
.
format
(
self
.
flip_ratio
)
repr_str
+=
'(flip_ratio_yz={})'
.
format
(
self
.
flip_ratio_yz
)
repr_str
+=
'(flip_ratio_xz={})'
.
format
(
self
.
flip_ratio_xz
)
return
repr_str
...
...
@@ -48,7 +57,8 @@ class IndoorFlipData(object):
class
IndoorPointsColorJitter
(
object
):
"""Indoor Points Color Jitter.
Augment the color of points.
Randomly change the brightness and color of the point cloud, and
drop out the points' colors with a certain range and probability.
Args:
color_mean (List[float]): Mean color of the point cloud.
...
...
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