diff --git a/tools/create_data.py b/tools/create_data.py index d8c6495d6a..c920e0b1fa 100644 --- a/tools/create_data.py +++ b/tools/create_data.py @@ -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') diff --git a/tools/dataset_converters/nuscenes_converter.py b/tools/dataset_converters/nuscenes_converter.py index c53a2871f3..34112cee61 100644 --- a/tools/dataset_converters/nuscenes_converter.py +++ b/tools/dataset_converters/nuscenes_converter.py @@ -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. @@ -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)