Skip to content

Commit

Permalink
make filepath handling more robust for different setups
Browse files Browse the repository at this point in the history
  • Loading branch information
TillBeemelmanns committed May 15, 2024
1 parent 3fb6c28 commit 5f8c677
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion converter/img_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
6 changes: 3 additions & 3 deletions converter/lidar_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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


Expand Down

0 comments on commit 5f8c677

Please sign in to comment.