|
| 1 | +# dataset settings |
| 2 | +# D3 in the config name means the whole dataset is divided into 3 folds |
| 3 | +# We only use one fold for efficient experiments |
| 4 | +dataset_type = 'WaymoDataset' |
| 5 | +data_root = 'data/waymo/kitti_format/' |
| 6 | +file_client_args = dict(backend='disk') |
| 7 | +# Uncomment the following if use ceph or other file clients. |
| 8 | +# See https://mmcv.readthedocs.io/en/latest/api.html#mmcv.fileio.FileClient |
| 9 | +# for more details. |
| 10 | + |
| 11 | +class_names = ['Car', 'Pedestrian', 'Cyclist'] |
| 12 | +input_modality = dict(use_lidar=False, use_camera=True) |
| 13 | +point_cloud_range = [-35.0, -75.0, -2, 75.0, 75.0, 4] |
| 14 | + |
| 15 | +train_transforms = [ |
| 16 | + dict(type='PhotoMetricDistortion3D'), |
| 17 | + dict( |
| 18 | + type='RandomResize3D', |
| 19 | + scale=(1248, 832), |
| 20 | + ratio_range=(0.95, 1.05), |
| 21 | + keep_ratio=True), |
| 22 | + dict(type='RandomCrop3D', crop_size=(720, 1080)), |
| 23 | + dict(type='RandomFlip3D', flip_ratio_bev_horizontal=0.5, flip_box3d=False), |
| 24 | +] |
| 25 | + |
| 26 | +train_pipeline = [ |
| 27 | + dict(type='LoadMultiViewImageFromFiles', to_float32=True), |
| 28 | + dict( |
| 29 | + type='LoadAnnotations3D', |
| 30 | + with_bbox=True, |
| 31 | + with_label=True, |
| 32 | + with_attr_label=False, |
| 33 | + with_bbox_3d=True, |
| 34 | + with_label_3d=True, |
| 35 | + with_bbox_depth=True), |
| 36 | + dict(type='MultiViewWrapper', transforms=train_transforms), |
| 37 | + dict(type='ObjectRangeFilter', point_cloud_range=point_cloud_range), |
| 38 | + dict(type='ObjectNameFilter', classes=class_names), |
| 39 | + dict( |
| 40 | + type='Pack3DDetInputs', keys=[ |
| 41 | + 'img', |
| 42 | + 'gt_bboxes_3d', |
| 43 | + 'gt_labels_3d', |
| 44 | + ]), |
| 45 | +] |
| 46 | +test_transforms = [ |
| 47 | + dict( |
| 48 | + type='RandomResize3D', |
| 49 | + scale=(1248, 832), |
| 50 | + ratio_range=(1., 1.), |
| 51 | + keep_ratio=True) |
| 52 | +] |
| 53 | +test_pipeline = [ |
| 54 | + dict(type='LoadMultiViewImageFromFiles', to_float32=True), |
| 55 | + dict(type='MultiViewWrapper', transforms=test_transforms), |
| 56 | + dict(type='Pack3DDetInputs', keys=['img']) |
| 57 | +] |
| 58 | +# construct a pipeline for data and gt loading in show function |
| 59 | +# please keep its loading function consistent with test_pipeline (e.g. client) |
| 60 | +eval_pipeline = [ |
| 61 | + dict(type='LoadMultiViewImageFromFiles', to_float32=True), |
| 62 | + dict(type='MultiViewWrapper', transforms=test_transforms), |
| 63 | + dict(type='Pack3DDetInputs', keys=['img']) |
| 64 | +] |
| 65 | +metainfo = dict(CLASSES=class_names) |
| 66 | + |
| 67 | +train_dataloader = dict( |
| 68 | + batch_size=2, |
| 69 | + num_workers=2, |
| 70 | + persistent_workers=True, |
| 71 | + sampler=dict(type='DefaultSampler', shuffle=True), |
| 72 | + dataset=dict( |
| 73 | + type=dataset_type, |
| 74 | + data_root=data_root, |
| 75 | + ann_file='waymo_infos_train.pkl', |
| 76 | + data_prefix=dict( |
| 77 | + pts='training/velodyne', |
| 78 | + CAM_FRONT='training/image_0', |
| 79 | + CAM_FRONT_RIGHT='training/image_1', |
| 80 | + CAM_FRONT_LEFT='training/image_2', |
| 81 | + CAM_SIDE_RIGHT='training/image_3', |
| 82 | + CAM_SIDE_LEFT='training/image_4', |
| 83 | + ), |
| 84 | + pipeline=train_pipeline, |
| 85 | + modality=input_modality, |
| 86 | + test_mode=False, |
| 87 | + metainfo=metainfo, |
| 88 | + box_type_3d='Lidar', |
| 89 | + load_interval=5, |
| 90 | + )) |
| 91 | + |
| 92 | +val_dataloader = dict( |
| 93 | + batch_size=1, |
| 94 | + num_workers=1, |
| 95 | + persistent_workers=True, |
| 96 | + drop_last=False, |
| 97 | + sampler=dict(type='DefaultSampler', shuffle=False), |
| 98 | + dataset=dict( |
| 99 | + type=dataset_type, |
| 100 | + data_root=data_root, |
| 101 | + ann_file='waymo_infos_val.pkl', |
| 102 | + data_prefix=dict( |
| 103 | + pts='training/velodyne', |
| 104 | + CAM_FRONT='training/image_0', |
| 105 | + CAM_FRONT_RIGHT='training/image_1', |
| 106 | + CAM_FRONT_LEFT='training/image_2', |
| 107 | + CAM_SIDE_RIGHT='training/image_3', |
| 108 | + CAM_SIDE_LEFT='training/image_4', |
| 109 | + ), |
| 110 | + pipeline=eval_pipeline, |
| 111 | + modality=input_modality, |
| 112 | + test_mode=True, |
| 113 | + metainfo=metainfo, |
| 114 | + box_type_3d='Lidar', |
| 115 | + )) |
| 116 | + |
| 117 | +test_dataloader = dict( |
| 118 | + batch_size=1, |
| 119 | + num_workers=1, |
| 120 | + persistent_workers=True, |
| 121 | + drop_last=False, |
| 122 | + sampler=dict(type='DefaultSampler', shuffle=False), |
| 123 | + dataset=dict( |
| 124 | + type=dataset_type, |
| 125 | + data_root=data_root, |
| 126 | + ann_file='waymo_infos_val.pkl', |
| 127 | + data_prefix=dict( |
| 128 | + pts='training/velodyne', |
| 129 | + CAM_FRONT='training/image_0', |
| 130 | + CAM_FRONT_RIGHT='training/image_1', |
| 131 | + CAM_FRONT_LEFT='training/image_2', |
| 132 | + CAM_SIDE_RIGHT='training/image_3', |
| 133 | + CAM_SIDE_LEFT='training/image_4', |
| 134 | + ), |
| 135 | + pipeline=eval_pipeline, |
| 136 | + modality=input_modality, |
| 137 | + test_mode=True, |
| 138 | + metainfo=metainfo, |
| 139 | + box_type_3d='Lidar', |
| 140 | + )) |
| 141 | +val_evaluator = dict( |
| 142 | + type='WaymoMetric', |
| 143 | + ann_file='./data/waymo/kitti_format/waymo_infos_val.pkl', |
| 144 | + waymo_bin_file='./data/waymo/waymo_format/cam_gt.bin', |
| 145 | + data_root='./data/waymo/waymo_format', |
| 146 | + metric='LET_mAP') |
| 147 | + |
| 148 | +test_evaluator = val_evaluator |
0 commit comments