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
14ac4d12
Commit
14ac4d12
authored
Jul 11, 2020
by
Shaoshuai Shi
Browse files
bugfixed: flip and rot velocity when doing augmentation
parent
cb32ff13
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
3 deletions
+17
-3
pcdet/datasets/augmentor/augmentor_utils.py
pcdet/datasets/augmentor/augmentor_utils.py
+17
-3
No files found.
pcdet/datasets/augmentor/augmentor_utils.py
View file @
14ac4d12
...
@@ -5,7 +5,7 @@ from ...utils import common_utils
...
@@ -5,7 +5,7 @@ from ...utils import common_utils
def
random_flip_along_x
(
gt_boxes
,
points
):
def
random_flip_along_x
(
gt_boxes
,
points
):
"""
"""
Args:
Args:
gt_boxes: (N, 7), [x, y, z, dx, dy, dz, heading]
gt_boxes: (N, 7
+ C
), [x, y, z, dx, dy, dz, heading
, [vx], [vy]
]
points: (M, 3 + C)
points: (M, 3 + C)
Returns:
Returns:
"""
"""
...
@@ -14,13 +14,17 @@ def random_flip_along_x(gt_boxes, points):
...
@@ -14,13 +14,17 @@ def random_flip_along_x(gt_boxes, points):
gt_boxes
[:,
1
]
=
-
gt_boxes
[:,
1
]
gt_boxes
[:,
1
]
=
-
gt_boxes
[:,
1
]
gt_boxes
[:,
6
]
=
-
gt_boxes
[:,
6
]
gt_boxes
[:,
6
]
=
-
gt_boxes
[:,
6
]
points
[:,
1
]
=
-
points
[:,
1
]
points
[:,
1
]
=
-
points
[:,
1
]
if
gt_boxes
.
shape
[
1
]
>
7
:
gt_boxes
[:,
8
]
=
-
gt_boxes
[:,
8
]
return
gt_boxes
,
points
return
gt_boxes
,
points
def
random_flip_along_y
(
gt_boxes
,
points
):
def
random_flip_along_y
(
gt_boxes
,
points
):
"""
"""
Args:
Args:
gt_boxes: (N, 7), [x, y, z, dx, dy, dz, heading]
gt_boxes: (N, 7
+ C
), [x, y, z, dx, dy, dz, heading
, [vx], [vy]
]
points: (M, 3 + C)
points: (M, 3 + C)
Returns:
Returns:
"""
"""
...
@@ -29,13 +33,17 @@ def random_flip_along_y(gt_boxes, points):
...
@@ -29,13 +33,17 @@ def random_flip_along_y(gt_boxes, points):
gt_boxes
[:,
0
]
=
-
gt_boxes
[:,
0
]
gt_boxes
[:,
0
]
=
-
gt_boxes
[:,
0
]
gt_boxes
[:,
6
]
=
-
(
gt_boxes
[:,
6
]
+
np
.
pi
)
gt_boxes
[:,
6
]
=
-
(
gt_boxes
[:,
6
]
+
np
.
pi
)
points
[:,
0
]
=
-
points
[:,
0
]
points
[:,
0
]
=
-
points
[:,
0
]
if
gt_boxes
.
shape
[
1
]
>
7
:
gt_boxes
[:,
7
]
=
-
gt_boxes
[:,
7
]
return
gt_boxes
,
points
return
gt_boxes
,
points
def
global_rotation
(
gt_boxes
,
points
,
rot_range
):
def
global_rotation
(
gt_boxes
,
points
,
rot_range
):
"""
"""
Args:
Args:
gt_boxes: (N, 7), [x, y, z, dx, dy, dz, heading]
gt_boxes: (N, 7
+ C
), [x, y, z, dx, dy, dz, heading
, [vx], [vy]
]
points: (M, 3 + C),
points: (M, 3 + C),
rot_range: [min, max]
rot_range: [min, max]
Returns:
Returns:
...
@@ -44,6 +52,12 @@ def global_rotation(gt_boxes, points, rot_range):
...
@@ -44,6 +52,12 @@ def global_rotation(gt_boxes, points, rot_range):
points
=
common_utils
.
rotate_points_along_z
(
points
[
np
.
newaxis
,
:,
:],
np
.
array
([
noise_rotation
]))[
0
]
points
=
common_utils
.
rotate_points_along_z
(
points
[
np
.
newaxis
,
:,
:],
np
.
array
([
noise_rotation
]))[
0
]
gt_boxes
[:,
0
:
3
]
=
common_utils
.
rotate_points_along_z
(
gt_boxes
[
np
.
newaxis
,
:,
0
:
3
],
np
.
array
([
noise_rotation
]))[
0
]
gt_boxes
[:,
0
:
3
]
=
common_utils
.
rotate_points_along_z
(
gt_boxes
[
np
.
newaxis
,
:,
0
:
3
],
np
.
array
([
noise_rotation
]))[
0
]
gt_boxes
[:,
6
]
+=
noise_rotation
gt_boxes
[:,
6
]
+=
noise_rotation
if
gt_boxes
.
shape
[
1
]
>
7
:
gt_boxes
[:,
7
:
9
]
=
common_utils
.
rotate_points_along_z
(
np
.
hstack
((
gt_boxes
[:,
7
:
9
],
np
.
zeros
((
gt_boxes
.
shape
[
0
],
1
))))[
np
.
newaxis
,
:,
:],
np
.
array
([
noise_rotation
])
)[
0
]
return
gt_boxes
,
points
return
gt_boxes
,
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