Unverified Commit 63ffbac9 authored by Xavier Santos's avatar Xavier Santos Committed by GitHub
Browse files

Added new augmentation methods and the option of augmentation by addition...


Added new augmentation methods and the option of augmentation by addition instead of replacement (#653)

* NOTEBOOK FOR DATA AUGMENTATION

* SMALL SAMPLE DATASET

* TRANSLACTIONS GLOBAL AND LOCAL

* LOCAL AUGMENTATIONS FINISHED

* ADJUSTED DATA FORMATS TO PCDET YAML COMPATIBILITY

* BUGFIX

* ADDED TITLES

* ADAPTED OPENPCDET TO FIT NEW AUGMENTATIONS

* SAVE IMAGES OF THE DATA AUGMENTATION EXAMPLES

* LOCAL TRANSFORMATION RANDOM VALUES VARY WITH OBJECT AND NOT SCENE

* FIXED YAML

* FIXED BUGS IN PARAMETERS

* FIX IN LOCAL BOXES

* NEW BOX FILTER

* FRUSTUM DROPOUT

* FRUSTUM DROPOUT IMPLEMENTED ON OPENPCDET

* REMOVE FIGURES FROM VERSION CONTROL

* MORE EFFICIENT LOCAL METHOD

* LOCAL TRANSFORMATION WITH NUMPY SPED UP

* BUGFIX ON AUGMENTATION FUNCTION

* GET PREDICTED LABELS

* AUGMENTATION DONE BY ADDITION

* RANDOM SELECTION OF REMAINIG FRAMES

* LOGGER WITH TRANSFORMATION DETAILS

* CHANGED COUNTER TO SAMPLE IDX SELECTION METHOD

* BUGFIX ON KITTY_DATABASE

* BUGFIX

* BUGFIX

* FIX ON GENERATOR

* DEBUG LOGS TO FILE

* FIXED LOGGER

* SAVE POINT CLOUDS TO OBJ FILE

* UPDATED NOTEBOOK

* CLEANUP

* .gitignore is now working

* fixed .gitignore

* REMOVED YAML FILES FROM .gitignore

* parse results to a csv

* yaml changed

* fixed gitignore

* FIXED BUG THAT DUPLICATED THE TEST SET

* small fixes on yaml

* fix gitignore

* updated generate_sets.py

* fixed csv_parser.py

* Delete output directory

* Delete output directory

* saving figures with better resolution

* implemented a way to chose to augment the raw pcs

* updated csv_parser.py

* fixed yamls to include the new selection system

* notebook updated

* mosaic added

* new models

* fixed gitignore

* fixed gitignore

* applied changes

* Delete data_aumentation.ipynb

* Delete pointpillar_fullaug.yaml

* updated gitignore

* bugfix

* updated training and notebook

* updated gitignore

* cleanup code

* updated yamls

* reset

* new augmentation methods

* example conf for pointpillars

* updated example config

* bugfix on the config file

* fixed get_points_in_box function

* fixed local frustum dropout

* fixed pointpillar_newaugs.yaml

* bugfixed: import math for some augmentations

* increased margin in point selection for local augmentation

* bugfixed: velocity should not be translated for translation augs. Add warning to check the correctness before using

* bugfixed: add back the aug of random_image_flip
Co-authored-by: default avatarShaoshuai Shi <shaoshuaics@gmail.com>
parent 3b0f5014
import copy
import numpy as np import numpy as np
import math
from ...utils import common_utils from ...utils import common_utils
...@@ -22,7 +22,6 @@ def random_flip_along_x(gt_boxes, points): ...@@ -22,7 +22,6 @@ def random_flip_along_x(gt_boxes, points):
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:
...@@ -41,7 +40,6 @@ def random_flip_along_y(gt_boxes, points): ...@@ -41,7 +40,6 @@ def random_flip_along_y(gt_boxes, points):
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:
...@@ -62,7 +60,6 @@ def global_rotation(gt_boxes, points, rot_range): ...@@ -62,7 +60,6 @@ def global_rotation(gt_boxes, points, rot_range):
return gt_boxes, points return gt_boxes, points
def global_scaling(gt_boxes, points, scale_range): def global_scaling(gt_boxes, points, scale_range):
""" """
Args: Args:
...@@ -76,6 +73,7 @@ def global_scaling(gt_boxes, points, scale_range): ...@@ -76,6 +73,7 @@ def global_scaling(gt_boxes, points, scale_range):
noise_scale = np.random.uniform(scale_range[0], scale_range[1]) noise_scale = np.random.uniform(scale_range[0], scale_range[1])
points[:, :3] *= noise_scale points[:, :3] *= noise_scale
gt_boxes[:, :6] *= noise_scale gt_boxes[:, :6] *= noise_scale
return gt_boxes, points return gt_boxes, points
def random_image_flip_horizontal(image, depth_map, gt_boxes, calib): def random_image_flip_horizontal(image, depth_map, gt_boxes, calib):
...@@ -115,4 +113,358 @@ def random_image_flip_horizontal(image, depth_map, gt_boxes, calib): ...@@ -115,4 +113,358 @@ def random_image_flip_horizontal(image, depth_map, gt_boxes, calib):
aug_depth_map = depth_map aug_depth_map = depth_map
aug_gt_boxes = gt_boxes aug_gt_boxes = gt_boxes
return aug_image, aug_depth_map, aug_gt_boxes return aug_image, aug_depth_map, aug_gt_boxes
\ No newline at end of file
def random_translation_along_x(gt_boxes, points, offset_range):
"""
Args:
gt_boxes: (N, 7), [x, y, z, dx, dy, dz, heading, [vx], [vy]]
points: (M, 3 + C),
offset_range: [min max]]
Returns:
"""
offset = np.random.uniform(offset_range[0], offset_range[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_range):
"""
Args:
gt_boxes: (N, 7), [x, y, z, dx, dy, dz, heading, [vx], [vy]]
points: (M, 3 + C),
offset_range: [min max]]
Returns:
"""
offset = np.random.uniform(offset_range[0], offset_range[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_range):
"""
Args:
gt_boxes: (N, 7), [x, y, z, dx, dy, dz, heading, [vx], [vy]]
points: (M, 3 + C),
offset_range: [min max]]
Returns:
"""
offset = np.random.uniform(offset_range[0], offset_range[1])
points[:, 2] += offset
gt_boxes[:, 2] += offset
return gt_boxes, points
def random_local_translation_along_x(gt_boxes, points, offset_range):
"""
Args:
gt_boxes: (N, 7), [x, y, z, dx, dy, dz, heading, [vx], [vy]]
points: (M, 3 + C),
offset_range: [min max]]
Returns:
"""
# augs = {}
for idx, box in enumerate(gt_boxes):
offset = np.random.uniform(offset_range[0], offset_range[1])
# augs[f'object_{idx}'] = offset
points_in_box, mask = get_points_in_box(points, box)
points[mask, 0] += offset
gt_boxes[idx, 0] += offset
# if gt_boxes.shape[1] > 7:
# gt_boxes[idx, 7] += offset
return gt_boxes, points
def random_local_translation_along_y(gt_boxes, points, offset_range):
"""
Args:
gt_boxes: (N, 7), [x, y, z, dx, dy, dz, heading, [vx], [vy]]
points: (M, 3 + C),
offset_range: [min max]]
Returns:
"""
# augs = {}
for idx, box in enumerate(gt_boxes):
offset = np.random.uniform(offset_range[0], offset_range[1])
# augs[f'object_{idx}'] = offset
points_in_box, mask = get_points_in_box(points, box)
points[mask, 1] += offset
gt_boxes[idx, 1] += offset
# if gt_boxes.shape[1] > 8:
# gt_boxes[idx, 8] += offset
return gt_boxes, points
def random_local_translation_along_z(gt_boxes, points, offset_range):
"""
Args:
gt_boxes: (N, 7), [x, y, z, dx, dy, dz, heading, [vx], [vy]]
points: (M, 3 + C),
offset_range: [min max]]
Returns:
"""
# augs = {}
for idx, box in enumerate(gt_boxes):
offset = np.random.uniform(offset_range[0], offset_range[1])
# augs[f'object_{idx}'] = offset
points_in_box, mask = get_points_in_box(points, box)
points[mask, 2] += offset
gt_boxes[idx, 2] += offset
return gt_boxes, points
def global_frustum_dropout_top(gt_boxes, points, intensity_range):
"""
Args:
gt_boxes: (N, 7), [x, y, z, dx, dy, dz, heading, [vx], [vy]],
points: (M, 3 + C),
intensity: [min, max]
Returns:
"""
intensity = np.random.uniform(intensity_range[0], intensity_range[1])
threshold = np.max(points[:, 2]) - intensity * (np.max(points[:, 2]) - np.min(points[:, 2]))
points = points[points[:,2] < threshold]
gt_boxes = gt_boxes[gt_boxes[:,2] < threshold]
return gt_boxes, points
def global_frustum_dropout_bottom(gt_boxes, points, intensity_range):
"""
Args:
gt_boxes: (N, 7), [x, y, z, dx, dy, dz, heading, [vx], [vy]],
points: (M, 3 + C),
intensity: [min, max]
Returns:
"""
intensity = np.random.uniform(intensity_range[0], intensity_range[1])
threshold = np.min(points[:, 2]) + intensity * (np.max(points[:, 2]) - np.min(points[:, 2]))
points = points[points[:,2] > threshold]
gt_boxes = gt_boxes[gt_boxes[:,2] > threshold]
return gt_boxes, points
def global_frustum_dropout_left(gt_boxes, points, intensity_range):
"""
Args:
gt_boxes: (N, 7), [x, y, z, dx, dy, dz, heading, [vx], [vy]],
points: (M, 3 + C),
intensity: [min, max]
Returns:
"""
intensity = np.random.uniform(intensity_range[0], intensity_range[1])
threshold = np.max(points[:, 1]) - intensity * (np.max(points[:, 1]) - np.min(points[:, 1]))
points = points[points[:,1] < threshold]
gt_boxes = gt_boxes[gt_boxes[:,1] < threshold]
return gt_boxes, points
def global_frustum_dropout_right(gt_boxes, points, intensity_range):
"""
Args:
gt_boxes: (N, 7), [x, y, z, dx, dy, dz, heading, [vx], [vy]],
points: (M, 3 + C),
intensity: [min, max]
Returns:
"""
intensity = np.random.uniform(intensity_range[0], intensity_range[1])
threshold = np.min(points[:, 1]) + intensity * (np.max(points[:, 1]) - np.min(points[:, 1]))
points = points[points[:,1] > threshold]
gt_boxes = gt_boxes[gt_boxes[:,1] > threshold]
return gt_boxes, points
def local_scaling(gt_boxes, points, scale_range):
"""
Args:
gt_boxes: (N, 7), [x, y, z, dx, dy, dz, heading]
points: (M, 3 + C),
scale_range: [min, max]
Returns:
"""
if scale_range[1] - scale_range[0] < 1e-3:
return gt_boxes, points
# augs = {}
for idx, box in enumerate(gt_boxes):
noise_scale = np.random.uniform(scale_range[0], scale_range[1])
# augs[f'object_{idx}'] = noise_scale
points_in_box, mask = get_points_in_box(points, box)
# tranlation to axis center
points[mask, 0] -= box[0]
points[mask, 1] -= box[1]
points[mask, 2] -= box[2]
# apply scaling
points[mask, :3] *= noise_scale
# tranlation back to original position
points[mask, 0] += box[0]
points[mask, 1] += box[1]
points[mask, 2] += box[2]
gt_boxes[idx, 3:6] *= noise_scale
return gt_boxes, points
def local_rotation(gt_boxes, points, rot_range):
"""
Args:
gt_boxes: (N, 7), [x, y, z, dx, dy, dz, heading, [vx], [vy]]
points: (M, 3 + C),
rot_range: [min, max]
Returns:
"""
# augs = {}
for idx, box in enumerate(gt_boxes):
noise_rotation = np.random.uniform(rot_range[0], rot_range[1])
# augs[f'object_{idx}'] = noise_rotation
points_in_box, mask = get_points_in_box(points, box)
centroid_x = box[0]
centroid_y = box[1]
centroid_z = box[2]
# tranlation to axis center
points[mask, 0] -= centroid_x
points[mask, 1] -= centroid_y
points[mask, 2] -= centroid_z
box[0] -= centroid_x
box[1] -= centroid_y
box[2] -= centroid_z
# apply rotation
points[mask, :] = common_utils.rotate_points_along_z(points[np.newaxis, mask, :], np.array([noise_rotation]))[0]
box[0:3] = common_utils.rotate_points_along_z(box[np.newaxis, np.newaxis, 0:3], np.array([noise_rotation]))[0][0]
# tranlation back to original position
points[mask, 0] += centroid_x
points[mask, 1] += centroid_y
points[mask, 2] += centroid_z
box[0] += centroid_x
box[1] += centroid_y
box[2] += centroid_z
gt_boxes[idx, 6] += noise_rotation
if gt_boxes.shape[1] > 8:
gt_boxes[idx, 7:9] = common_utils.rotate_points_along_z(
np.hstack((gt_boxes[idx, 7:9], np.zeros((gt_boxes.shape[0], 1))))[np.newaxis, :, :],
np.array([noise_rotation])
)[0][:, 0:2]
return gt_boxes, points
def local_frustum_dropout_top(gt_boxes, points, intensity_range):
"""
Args:
gt_boxes: (N, 7), [x, y, z, dx, dy, dz, heading, [vx], [vy]],
points: (M, 3 + C),
intensity: [min, max]
Returns:
"""
for idx, box in enumerate(gt_boxes):
x, y, z, dx, dy, dz = box[0], box[1], box[2], box[3], box[4], box[5]
intensity = np.random.uniform(intensity_range[0], intensity_range[1])
points_in_box, mask = get_points_in_box(points, box)
threshold = (z + dz/2) - intensity * dz
points = points[np.logical_not(np.logical_and(mask, points[:,2] >= threshold))]
return gt_boxes, points
def local_frustum_dropout_bottom(gt_boxes, points, intensity_range):
"""
Args:
gt_boxes: (N, 7), [x, y, z, dx, dy, dz, heading, [vx], [vy]],
points: (M, 3 + C),
intensity: [min, max]
Returns:
"""
for idx, box in enumerate(gt_boxes):
x, y, z, dx, dy, dz = box[0], box[1], box[2], box[3], box[4], box[5]
intensity = np.random.uniform(intensity_range[0], intensity_range[1])
points_in_box, mask = get_points_in_box(points, box)
threshold = (z - dz/2) + intensity * dz
points = points[np.logical_not(np.logical_and(mask, points[:,2] <= threshold))]
return gt_boxes, points
def local_frustum_dropout_left(gt_boxes, points, intensity_range):
"""
Args:
gt_boxes: (N, 7), [x, y, z, dx, dy, dz, heading, [vx], [vy]],
points: (M, 3 + C),
intensity: [min, max]
Returns:
"""
for idx, box in enumerate(gt_boxes):
x, y, z, dx, dy, dz = box[0], box[1], box[2], box[3], box[4], box[5]
intensity = np.random.uniform(intensity_range[0], intensity_range[1])
points_in_box, mask = get_points_in_box(points, box)
threshold = (y + dy/2) - intensity * dy
points = points[np.logical_not(np.logical_and(mask, points[:,1] >= threshold))]
return gt_boxes, points
def local_frustum_dropout_right(gt_boxes, points, intensity_range):
"""
Args:
gt_boxes: (N, 7), [x, y, z, dx, dy, dz, heading, [vx], [vy]],
points: (M, 3 + C),
intensity: [min, max]
Returns:
"""
for idx, box in enumerate(gt_boxes):
x, y, z, dx, dy, dz = box[0], box[1], box[2], box[3], box[4], box[5]
intensity = np.random.uniform(intensity_range[0], intensity_range[1])
points_in_box, mask = get_points_in_box(points, box)
threshold = (y - dy/2) + intensity * dy
points = points[np.logical_not(np.logical_and(mask, points[:,1] <= threshold))]
return gt_boxes, points
def get_points_in_box(points, gt_box):
x, y, z = points[:,0], points[:,1], points[:,2]
cx, cy, cz = gt_box[0], gt_box[1], gt_box[2]
dx, dy, dz, rz = gt_box[3], gt_box[4], gt_box[5], gt_box[6]
shift_x, shift_y, shift_z = x - cx, y - cy, z - cz
MARGIN = 1e-1
cosa, sina = math.cos(-rz), math.sin(-rz)
local_x = shift_x * cosa + shift_y * (-sina)
local_y = shift_x * sina + shift_y * cosa
mask = np.logical_and(abs(shift_z) <= dz / 2.0, \
np.logical_and(abs(local_x) <= dx / 2.0 + MARGIN, \
abs(local_y) <= dy / 2.0 + MARGIN ))
points = points[mask]
return points, mask
...@@ -39,7 +39,7 @@ class DataAugmentor(object): ...@@ -39,7 +39,7 @@ class DataAugmentor(object):
def __setstate__(self, d): def __setstate__(self, d):
self.__dict__.update(d) self.__dict__.update(d)
def random_world_flip(self, data_dict=None, config=None): def random_world_flip(self, data_dict=None, config=None):
if data_dict is None: if data_dict is None:
return partial(self.random_world_flip, config=config) return partial(self.random_world_flip, config=config)
...@@ -74,6 +74,7 @@ class DataAugmentor(object): ...@@ -74,6 +74,7 @@ class DataAugmentor(object):
gt_boxes, points = augmentor_utils.global_scaling( gt_boxes, points = augmentor_utils.global_scaling(
data_dict['gt_boxes'], data_dict['points'], config['WORLD_SCALE_RANGE'] data_dict['gt_boxes'], data_dict['points'], config['WORLD_SCALE_RANGE']
) )
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
...@@ -97,6 +98,111 @@ class DataAugmentor(object): ...@@ -97,6 +98,111 @@ class DataAugmentor(object):
data_dict['gt_boxes'] = gt_boxes data_dict['gt_boxes'] = gt_boxes
return data_dict return data_dict
def random_world_translation(self, data_dict=None, config=None):
"""
Please check the correctness of it before using.
"""
if data_dict is None:
return partial(self.random_world_translation, config=config)
offset_range = config['WORLD_TRANSLATION_RANGE']
gt_boxes, points = data_dict['gt_boxes'], data_dict['points']
for cur_axis in config['ALONG_AXIS_LIST']:
assert cur_axis in ['x', 'y', 'z']
gt_boxes, points = getattr(augmentor_utils, 'random_translation_along_%s' % cur_axis)(
gt_boxes, points, offset_range,
)
data_dict['gt_boxes'] = gt_boxes
data_dict['points'] = points
return data_dict
def random_local_translation(self, data_dict=None, config=None):
"""
Please check the correctness of it before using.
"""
if data_dict is None:
return partial(self.random_local_translation, config=config)
offset_range = config['LOCAL_TRANSLATION_RANGE']
gt_boxes, points = data_dict['gt_boxes'], data_dict['points']
for cur_axis in config['ALONG_AXIS_LIST']:
assert cur_axis in ['x', 'y', 'z']
gt_boxes, points = getattr(augmentor_utils, 'random_local_translation_along_%s' % cur_axis)(
gt_boxes, points, offset_range,
)
data_dict['gt_boxes'] = gt_boxes
data_dict['points'] = points
return data_dict
def random_local_rotation(self, data_dict=None, config=None):
"""
Please check the correctness of it before using.
"""
if data_dict is None:
return partial(self.random_local_rotation, config=config)
rot_range = config['LOCAL_ROT_ANGLE']
if not isinstance(rot_range, list):
rot_range = [-rot_range, rot_range]
gt_boxes, points = augmentor_utils.local_rotation(
data_dict['gt_boxes'], data_dict['points'], rot_range=rot_range
)
data_dict['gt_boxes'] = gt_boxes
data_dict['points'] = points
return data_dict
def random_local_scaling(self, data_dict=None, config=None):
"""
Please check the correctness of it before using.
"""
if data_dict is None:
return partial(self.random_local_scaling, config=config)
gt_boxes, points = augmentor_utils.local_scaling(
data_dict['gt_boxes'], data_dict['points'], config['LOCAL_SCALE_RANGE']
)
data_dict['gt_boxes'] = gt_boxes
data_dict['points'] = points
return data_dict
def random_world_frustum_dropout(self, data_dict=None, config=None):
"""
Please check the correctness of it before using.
"""
if data_dict is None:
return partial(self.random_world_frustum_dropout, config=config)
intensity_range = config['INTENSITY_RANGE']
gt_boxes, points = data_dict['gt_boxes'], data_dict['points']
for direction in config['DIRECTION']:
assert direction in ['top', 'bottom', 'left', 'right']
gt_boxes, points = getattr(augmentor_utils, 'global_frustum_dropout_%s' % direction)(
gt_boxes, points, intensity_range,
)
data_dict['gt_boxes'] = gt_boxes
data_dict['points'] = points
return data_dict
def random_local_frustum_dropout(self, data_dict=None, config=None):
"""
Please check the correctness of it before using.
"""
if data_dict is None:
return partial(self.random_local_frustum_dropout, config=config)
intensity_range = config['INTENSITY_RANGE']
gt_boxes, points = data_dict['gt_boxes'], data_dict['points']
for direction in config['DIRECTION']:
assert direction in ['top', 'bottom', 'left', 'right']
gt_boxes, points = getattr(augmentor_utils, 'local_frustum_dropout_%s' % direction)(
gt_boxes, points, intensity_range,
)
data_dict['gt_boxes'] = gt_boxes
data_dict['points'] = points
return data_dict
def forward(self, data_dict): def forward(self, data_dict):
""" """
Args: Args:
...@@ -126,4 +232,4 @@ class DataAugmentor(object): ...@@ -126,4 +232,4 @@ class DataAugmentor(object):
data_dict['gt_boxes2d'] = data_dict['gt_boxes2d'][gt_boxes_mask] data_dict['gt_boxes2d'] = data_dict['gt_boxes2d'][gt_boxes_mask]
data_dict.pop('gt_boxes_mask') data_dict.pop('gt_boxes_mask')
return data_dict return data_dict
\ No newline at end of file
CLASS_NAMES: ['Car', 'Pedestrian', 'Cyclist']
DATA_CONFIG:
_BASE_CONFIG_: cfgs/dataset_configs/kitti_dataset.yaml
POINT_CLOUD_RANGE: [0, -39.68, -3, 69.12, 39.68, 1]
DATA_PROCESSOR:
- NAME: mask_points_and_boxes_outside_range
REMOVE_OUTSIDE_BOXES: True
- NAME: shuffle_points
SHUFFLE_ENABLED: {
'train': True,
'test': False
}
- NAME: transform_points_to_voxels
VOXEL_SIZE: [0.16, 0.16, 4]
MAX_POINTS_PER_VOXEL: 32
MAX_NUMBER_OF_VOXELS: {
'train': 16000,
'test': 40000
}
DATA_AUGMENTOR:
DISABLE_AUG_LIST: ['random_world_frustum_dropout', 'random_local_frustum_dropout', 'random_local_translation']
AUG_CONFIG_LIST:
- NAME: gt_sampling
USE_ROAD_PLANE: False
DB_INFO_PATH:
- kitti_dbinfos_train.pkl
PREPARE: {
filter_by_min_points: ['Car:5', 'Pedestrian:5', 'Cyclist:5'],
filter_by_difficulty: [-1, 2],
}
SAMPLE_GROUPS: ['Car:15','Pedestrian:15', 'Cyclist:15']
NUM_POINT_FEATURES: 4
DATABASE_WITH_FAKELIDAR: False
REMOVE_EXTRA_WIDTH: [0.0, 0.0, 0.0]
LIMIT_WHOLE_SCENE: False
- NAME: random_local_rotation
LOCAL_ROT_ANGLE: [-0.15707963267, 0.15707963267]
- NAME: random_local_scaling
LOCAL_SCALE_RANGE: [0.95, 1.05]
- NAME: random_world_flip
ALONG_AXIS_LIST: ['x']
- NAME: random_world_rotation
WORLD_ROT_ANGLE: [-0.78539816, 0.78539816]
- NAME: random_world_scaling
WORLD_SCALE_RANGE: [0.95, 1.05]
- NAME: random_world_translation
WORLD_TRANSLATION_RANGE: [ -0.2, 0.2 ]
ALONG_AXIS_LIST: ['x', 'y', 'z']
- NAME: random_local_translation
LOCAL_TRANSLATION_RANGE: [0.95, 1.05]
ALONG_AXIS_LIST: ['x', 'y', 'z']
- NAME: random_world_frustum_dropout
INTENSITY_RANGE: [ 0, 0.2 ]
DIRECTION: ['top']
- NAME: random_local_frustum_dropout
INTENSITY_RANGE: [ 0, 0.2 ]
DIRECTION: ['top']
MODEL:
NAME: PointPillar
VFE:
NAME: PillarVFE
WITH_DISTANCE: False
USE_ABSLOTE_XYZ: True
USE_NORM: True
NUM_FILTERS: [64]
MAP_TO_BEV:
NAME: PointPillarScatter
NUM_BEV_FEATURES: 64
BACKBONE_2D:
NAME: BaseBEVBackbone
LAYER_NUMS: [3, 5, 5]
LAYER_STRIDES: [2, 2, 2]
NUM_FILTERS: [64, 128, 256]
UPSAMPLE_STRIDES: [1, 2, 4]
NUM_UPSAMPLE_FILTERS: [128, 128, 128]
DENSE_HEAD:
NAME: AnchorHeadSingle
CLASS_AGNOSTIC: False
USE_DIRECTION_CLASSIFIER: True
DIR_OFFSET: 0.78539
DIR_LIMIT_OFFSET: 0.0
NUM_DIR_BINS: 2
ANCHOR_GENERATOR_CONFIG: [
{
'class_name': 'Car',
'anchor_sizes': [[3.9, 1.6, 1.56]],
'anchor_rotations': [0, 1.57],
'anchor_bottom_heights': [-1.78],
'align_center': False,
'feature_map_stride': 2,
'matched_threshold': 0.6,
'unmatched_threshold': 0.45
},
{
'class_name': 'Pedestrian',
'anchor_sizes': [[0.8, 0.6, 1.73]],
'anchor_rotations': [0, 1.57],
'anchor_bottom_heights': [-0.6],
'align_center': False,
'feature_map_stride': 2,
'matched_threshold': 0.5,
'unmatched_threshold': 0.35
},
{
'class_name': 'Cyclist',
'anchor_sizes': [[1.76, 0.6, 1.73]],
'anchor_rotations': [0, 1.57],
'anchor_bottom_heights': [-0.6],
'align_center': False,
'feature_map_stride': 2,
'matched_threshold': 0.5,
'unmatched_threshold': 0.35
}
]
TARGET_ASSIGNER_CONFIG:
NAME: AxisAlignedTargetAssigner
POS_FRACTION: -1.0
SAMPLE_SIZE: 512
NORM_BY_NUM_EXAMPLES: False
MATCH_HEIGHT: False
BOX_CODER: ResidualCoder
LOSS_CONFIG:
LOSS_WEIGHTS: {
'cls_weight': 1.0,
'loc_weight': 2.0,
'dir_weight': 0.2,
'code_weights': [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]
}
POST_PROCESSING:
RECALL_THRESH_LIST: [0.3, 0.5, 0.7]
SCORE_THRESH: 0.1
OUTPUT_RAW_SCORE: False
EVAL_METRIC: kitti
NMS_CONFIG:
MULTI_CLASSES_NMS: False
NMS_TYPE: nms_gpu
NMS_THRESH: 0.01
NMS_PRE_MAXSIZE: 4096
NMS_POST_MAXSIZE: 500
OPTIMIZATION:
BATCH_SIZE_PER_GPU: 4
NUM_EPOCHS: 80
OPTIMIZER: adam_onecycle
LR: 0.003
WEIGHT_DECAY: 0.01
MOMENTUM: 0.9
MOMS: [0.95, 0.85]
PCT_START: 0.4
DIV_FACTOR: 10
DECAY_STEP_LIST: [35, 45]
LR_DECAY: 0.1
LR_CLIP: 0.0000001
LR_WARMUP: False
WARMUP_EPOCH: 1
GRAD_NORM_CLIP: 10
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment