Unverified Commit 31faf9fc authored by VVsssssk's avatar VVsssssk Committed by GitHub
Browse files

[Fix]Fix dataset sweeps (#1751)

* fix dataset sweeps

* fix

* fix cfg

* fix comments
parent 4f88f1a5
......@@ -11,7 +11,7 @@ data_root = 'data/lyft/'
# Input modality for Lyft dataset, this is consistent with the submission
# format which requires the information in input_modality.
input_modality = dict(use_lidar=True, use_camera=False)
data_prefix = dict(pts='samples/LIDAR_TOP', img='')
data_prefix = dict(pts='samples/LIDAR_TOP', img='', sweeps='sweeps/LIDAR_TOP')
file_client_args = dict(backend='disk')
# Uncomment the following if use ceph or other file clients.
......
......@@ -12,7 +12,7 @@ data_root = 'data/nuscenes/'
# Input modality for nuScenes dataset, this is consistent with the submission
# format which requires the information in input_modality.
input_modality = dict(use_lidar=True, use_camera=False)
data_prefix = dict(pts='samples/LIDAR_TOP', img='')
data_prefix = dict(pts='samples/LIDAR_TOP', img='', sweeps='sweeps/LIDAR_TOP')
file_client_args = dict(backend='disk')
# Uncomment the following if use ceph or other file clients.
......
......@@ -9,7 +9,7 @@ class_names = [
'car', 'truck', 'construction_vehicle', 'bus', 'trailer', 'barrier',
'motorcycle', 'bicycle', 'pedestrian', 'traffic_cone'
]
data_prefix = dict(pts='samples/LIDAR_TOP', img='')
data_prefix = dict(pts='samples/LIDAR_TOP', img='', sweeps='sweeps/LIDAR_TOP')
model = dict(
data_preprocessor=dict(
voxel_layer=dict(
......
......@@ -12,7 +12,7 @@ class_names = [
'car', 'truck', 'construction_vehicle', 'bus', 'trailer', 'barrier',
'motorcycle', 'bicycle', 'pedestrian', 'traffic_cone'
]
data_prefix = dict(pts='samples/LIDAR_TOP', img='')
data_prefix = dict(pts='samples/LIDAR_TOP', img='', sweeps='sweeps/LIDAR_TOP')
model = dict(
data_preprocessor=dict(
voxel_layer=dict(point_cloud_range=point_cloud_range)),
......
......@@ -12,7 +12,7 @@ class_names = [
'car', 'truck', 'construction_vehicle', 'bus', 'trailer', 'barrier',
'motorcycle', 'bicycle', 'pedestrian', 'traffic_cone'
]
data_prefix = dict(pts='samples/LIDAR_TOP', img='')
data_prefix = dict(pts='samples/LIDAR_TOP', img='', sweeps='sweeps/LIDAR_TOP')
model = dict(
data_preprocessor=dict(
voxel_layer=dict(point_cloud_range=point_cloud_range)),
......
......@@ -93,6 +93,7 @@ class Det3DDataset(BaseDataset):
f', `use_camera`) for {self.__class__.__name__}')
self.box_type_3d, self.box_mode_3d = get_box_type(box_type_3d)
if metainfo is not None and 'CLASSES' in metainfo:
# we allow to train on subset of self.METAINFO['CLASSES']
# map unselected labels to -1
......@@ -111,10 +112,6 @@ class Det3DDataset(BaseDataset):
}
self.label_mapping[-1] = -1
# can be accessed by other component in runner
metainfo['box_type_3d'] = box_type_3d
metainfo['label_mapping'] = self.label_mapping
super().__init__(
ann_file=ann_file,
metainfo=metainfo,
......@@ -124,6 +121,10 @@ class Det3DDataset(BaseDataset):
test_mode=test_mode,
**kwargs)
# can be accessed by other component in runner
self.metainfo['box_type_3d'] = box_type_3d
self.metainfo['label_mapping'] = self.label_mapping
def _remove_dontcare(self, ann_info):
"""Remove annotations that do not need to be cared.
......@@ -235,6 +236,16 @@ class Det3DDataset(BaseDataset):
info['lidar_points']['lidar_path'])
info['lidar_path'] = info['lidar_points']['lidar_path']
if 'lidar_sweeps' in info:
for sweep in info['lidar_sweeps']:
file_suffix = sweep['lidar_points']['lidar_path'].split(
'/')[-1]
if 'samples' in sweep['lidar_points']['lidar_path']:
sweep['lidar_points']['lidar_path'] = osp.join(
self.data_prefix['pts'], file_suffix)
else:
sweep['lidar_points']['lidar_path'] = osp.join(
self.data_prefix['sweeps'], file_suffix)
if self.modality['use_camera']:
for cam_id, img_info in info['images'].items():
......
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