Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mismatch between the output path of pkl and input path . #3069

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion tools/create_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@ 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
9 changes: 4 additions & 5 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,16 @@ 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,
'{}_infos_test.pkl'.format(info_prefix))
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,
'{}_infos_train.pkl'.format(info_prefix))
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