Skip to content

Commit

Permalink
Fix: Fix mismatch between the output path of pkl files generated by c…
Browse files Browse the repository at this point in the history
…reate_data and the input path expected by subsequent processes.
  • Loading branch information
1ofoo committed Dec 16, 2024
1 parent fe25f7a commit 104d603
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tools/create_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def nuscenes_data_prep(root_path,
Default: 10
"""
nuscenes_converter.create_nuscenes_infos(
root_path, info_prefix, version=version, max_sweeps=max_sweeps)
root_path, info_prefix, out_dir, version=version, max_sweeps=max_sweeps)

if version == 'v1.0-test':
info_test_path = osp.join(out_dir, f'{info_prefix}_infos_test.pkl')
Expand Down
7 changes: 4 additions & 3 deletions tools/dataset_converters/nuscenes_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

def create_nuscenes_infos(root_path,
info_prefix,
out_dir,
version='v1.0-trainval',
max_sweeps=10):
"""Create info file of nuscene dataset.
Expand Down Expand Up @@ -86,18 +87,18 @@ def create_nuscenes_infos(root_path,
if test:
print('test sample: {}'.format(len(train_nusc_infos)))
data = dict(infos=train_nusc_infos, metadata=metadata)
info_path = osp.join(root_path,
info_path = osp.join(out_dir,
'{}_infos_test.pkl'.format(info_prefix))
mmengine.dump(data, info_path)
else:
print('train sample: {}, val sample: {}'.format(
len(train_nusc_infos), len(val_nusc_infos)))
data = dict(infos=train_nusc_infos, metadata=metadata)
info_path = osp.join(root_path,
info_path = osp.join(out_dir,
'{}_infos_train.pkl'.format(info_prefix))
mmengine.dump(data, info_path)
data['infos'] = val_nusc_infos
info_val_path = osp.join(root_path,
info_val_path = osp.join(out_dir,
'{}_infos_val.pkl'.format(info_prefix))
mmengine.dump(data, info_val_path)

Expand Down

0 comments on commit 104d603

Please sign in to comment.