diff --git a/converter/img_converter.py b/converter/img_converter.py index 9aca468..e9e8ce6 100644 --- a/converter/img_converter.py +++ b/converter/img_converter.py @@ -29,7 +29,7 @@ def update_pathes(infos): """ for info in infos: for k, v in info['cams'].items(): - info['cams'][k]['data_path'] = v['data_path'][16:] + info['cams'][k]['data_path'] = os.path.join(*v['data_path'].split(os.path.sep)[-3:]) return infos diff --git a/converter/lidar_converter.py b/converter/lidar_converter.py index 73778b5..d8d6f7e 100644 --- a/converter/lidar_converter.py +++ b/converter/lidar_converter.py @@ -25,7 +25,7 @@ def update_pathes_dev1x(infos): if 'lidar_sweeps' in info: for sweep_info in info['lidar_sweeps']: sweep_pathes.append({ - "data_path": sweep_info['lidar_points']['lidar_path'][16:] + "data_path": os.path.join(*sweep_info['lidar_points']['lidar_path'].split(os.path.sep)[-3:]) }) info['sweeps'] = sweep_pathes return infos @@ -36,9 +36,9 @@ def update_pathes(infos): Remove the first 16 characters from the data_path. """ for info in infos: - info['lidar_path'] = info['lidar_path'][16:] + info['lidar_path'] = os.path.join(*info['lidar_path'].split(os.path.sep)[-3:]) for sweep in info['sweeps']: - sweep['data_path'] = sweep['data_path'][16:] + sweep['data_path'] = os.path.join(*sweep['data_path'].split(os.path.sep)[-3:]) return infos