@@ -55,7 +55,7 @@ def global_rotation(gt_boxes, points, rot_range, return_rot=False, noise_rotatio
55
55
def global_scaling (gt_boxes , points , scale_range , return_scale = False ):
56
56
"""
57
57
Args:
58
- gt_boxes: (N, 7), [x, y, z, dx, dy, dz, heading]
58
+ gt_boxes: (N, 7), [x, y, z, dx, dy, dz, heading, [vx], [vy] ]
59
59
points: (M, 3 + C),
60
60
scale_range: [min, max]
61
61
Returns:
@@ -66,7 +66,7 @@ def global_scaling(gt_boxes, points, scale_range, return_scale=False):
66
66
points [:, :3 ] *= noise_scale
67
67
gt_boxes [:, :6 ] *= noise_scale
68
68
if gt_boxes .shape [1 ] > 7 :
69
- gt_boxes [:, 7 :] *= noise_scale
69
+ gt_boxes [:, 7 :9 ] *= noise_scale
70
70
71
71
if return_scale :
72
72
return gt_boxes , points , noise_scale
@@ -75,7 +75,7 @@ def global_scaling(gt_boxes, points, scale_range, return_scale=False):
75
75
def global_scaling_with_roi_boxes (gt_boxes , roi_boxes , points , scale_range , return_scale = False ):
76
76
"""
77
77
Args:
78
- gt_boxes: (N, 7), [x, y, z, dx, dy, dz, heading]
78
+ gt_boxes: (N, 7), [x, y, z, dx, dy, dz, heading, [vx], [vy] ]
79
79
points: (M, 3 + C),
80
80
scale_range: [min, max]
81
81
Returns:
@@ -85,7 +85,11 @@ def global_scaling_with_roi_boxes(gt_boxes, roi_boxes, points, scale_range, retu
85
85
noise_scale = np .random .uniform (scale_range [0 ], scale_range [1 ])
86
86
points [:, :3 ] *= noise_scale
87
87
gt_boxes [:, :6 ] *= noise_scale
88
+ if gt_boxes .shape [1 ] > 7 :
89
+ gt_boxes [:, 7 :9 ] *= noise_scale
90
+
88
91
roi_boxes [:,:, [0 ,1 ,2 ,3 ,4 ,5 ,7 ,8 ]] *= noise_scale
92
+
89
93
if return_scale :
90
94
return gt_boxes ,roi_boxes , points , noise_scale
91
95
return gt_boxes , roi_boxes , points
0 commit comments