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
58bca13f
Commit
58bca13f
authored
Aug 24, 2022
by
Shaoshuai Shi
Browse files
update the function of random_world_translation
parent
8bf333f9
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
66 deletions
+11
-66
pcdet/datasets/augmentor/augmentor_utils.py
pcdet/datasets/augmentor/augmentor_utils.py
+0
-54
pcdet/datasets/augmentor/data_augmentor.py
pcdet/datasets/augmentor/data_augmentor.py
+9
-8
tools/cfgs/kitti_models/pointpillar_newaugs.yaml
tools/cfgs/kitti_models/pointpillar_newaugs.yaml
+1
-2
tools/cfgs/nuscenes_models/cbgs_voxel0075_res3d_centerpoint.yaml
...fgs/nuscenes_models/cbgs_voxel0075_res3d_centerpoint.yaml
+1
-2
No files found.
pcdet/datasets/augmentor/augmentor_utils.py
View file @
58bca13f
...
@@ -126,60 +126,6 @@ def random_image_flip_horizontal(image, depth_map, gt_boxes, calib):
...
@@ -126,60 +126,6 @@ def random_image_flip_horizontal(image, depth_map, gt_boxes, calib):
return
aug_image
,
aug_depth_map
,
aug_gt_boxes
return
aug_image
,
aug_depth_map
,
aug_gt_boxes
def
random_translation_along_x
(
gt_boxes
,
points
,
offset_std
):
"""
Args:
gt_boxes: (N, 7), [x, y, z, dx, dy, dz, heading, [vx], [vy]]
points: (M, 3 + C),
offset_std: float
Returns:
"""
offset
=
np
.
random
.
normal
(
0
,
offset_std
,
1
)
points
[:,
0
]
+=
offset
gt_boxes
[:,
0
]
+=
offset
# if gt_boxes.shape[1] > 7:
# gt_boxes[:, 7] += offset
return
gt_boxes
,
points
def
random_translation_along_y
(
gt_boxes
,
points
,
offset_std
):
"""
Args:
gt_boxes: (N, 7), [x, y, z, dx, dy, dz, heading, [vx], [vy]]
points: (M, 3 + C),
offset_std: float
Returns:
"""
offset
=
np
.
random
.
normal
(
0
,
offset_std
,
1
)
points
[:,
1
]
+=
offset
gt_boxes
[:,
1
]
+=
offset
# if gt_boxes.shape[1] > 8:
# gt_boxes[:, 8] += offset
return
gt_boxes
,
points
def
random_translation_along_z
(
gt_boxes
,
points
,
offset_std
):
"""
Args:
gt_boxes: (N, 7), [x, y, z, dx, dy, dz, heading, [vx], [vy]]
points: (M, 3 + C),
offset_std: float
Returns:
"""
offset
=
np
.
random
.
normal
(
0
,
offset_std
,
1
)
points
[:,
2
]
+=
offset
gt_boxes
[:,
2
]
+=
offset
return
gt_boxes
,
points
def
random_local_translation_along_x
(
gt_boxes
,
points
,
offset_range
):
def
random_local_translation_along_x
(
gt_boxes
,
points
,
offset_range
):
"""
"""
Args:
Args:
...
...
pcdet/datasets/augmentor/data_augmentor.py
View file @
58bca13f
...
@@ -105,15 +105,16 @@ class DataAugmentor(object):
...
@@ -105,15 +105,16 @@ class DataAugmentor(object):
if
data_dict
is
None
:
if
data_dict
is
None
:
return
partial
(
self
.
random_world_translation
,
config
=
config
)
return
partial
(
self
.
random_world_translation
,
config
=
config
)
noise_translate_std
=
config
[
'NOISE_TRANSLATE_STD'
]
noise_translate_std
=
config
[
'NOISE_TRANSLATE_STD'
]
if
noise_translate_std
==
0
:
assert
len
(
noise_translate_std
)
==
3
return
data_dict
noise_translate
=
np
.
array
([
gt_boxes
,
points
=
data_dict
[
'gt_boxes'
],
data_dict
[
'points'
]
np
.
random
.
normal
(
0
,
noise_translate_std
[
0
],
1
),
for
cur_axis
in
config
[
'ALONG_AXIS_LIST'
]:
np
.
random
.
normal
(
0
,
noise_translate_std
[
1
],
1
),
assert
cur_axis
in
[
'x'
,
'y'
,
'z'
]
np
.
random
.
normal
(
0
,
noise_translate_std
[
2
],
1
),
gt_boxes
,
points
=
getattr
(
augmentor_utils
,
'random_translation_along_%s'
%
cur_axis
)(
],
dtype
=
np
.
float32
).
T
gt_boxes
,
points
,
noise_translate_std
,
)
gt_boxes
,
points
=
data_dict
[
'gt_boxes'
],
data_dict
[
'points'
]
points
[:,
:
3
]
+=
noise_translate
gt_boxes
[:,
:
3
]
+=
noise_translate
data_dict
[
'gt_boxes'
]
=
gt_boxes
data_dict
[
'gt_boxes'
]
=
gt_boxes
data_dict
[
'points'
]
=
points
data_dict
[
'points'
]
=
points
return
data_dict
return
data_dict
...
...
tools/cfgs/kitti_models/pointpillar_newaugs.yaml
View file @
58bca13f
...
@@ -54,8 +54,7 @@ DATA_CONFIG:
...
@@ -54,8 +54,7 @@ DATA_CONFIG:
WORLD_SCALE_RANGE
:
[
0.95
,
1.05
]
WORLD_SCALE_RANGE
:
[
0.95
,
1.05
]
-
NAME
:
random_world_translation
-
NAME
:
random_world_translation
WORLD_TRANSLATION_RANGE
:
[
-0.2
,
0.2
]
NOISE_TRANSLATE_STD
:
[
0.5
,
0.5
,
0.5
]
ALONG_AXIS_LIST
:
[
'
x'
,
'
y'
,
'
z'
]
-
NAME
:
random_local_translation
-
NAME
:
random_local_translation
LOCAL_TRANSLATION_RANGE
:
[
0.95
,
1.05
]
LOCAL_TRANSLATION_RANGE
:
[
0.95
,
1.05
]
...
...
tools/cfgs/nuscenes_models/cbgs_voxel0075_res3d_centerpoint.yaml
View file @
58bca13f
...
@@ -38,8 +38,7 @@ DATA_CONFIG:
...
@@ -38,8 +38,7 @@ DATA_CONFIG:
WORLD_SCALE_RANGE
:
[
0.9
,
1.1
]
WORLD_SCALE_RANGE
:
[
0.9
,
1.1
]
-
NAME
:
random_world_translation
-
NAME
:
random_world_translation
NOISE_TRANSLATE_STD
:
0.5
NOISE_TRANSLATE_STD
:
[
0.5
,
0.5
,
0.5
]
ALONG_AXIS_LIST
:
[
'
x'
,
'
y'
,
'
z'
]
DATA_PROCESSOR
:
DATA_PROCESSOR
:
...
...
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