From 104d60354b20f7978e27350877cbd6c305fb70de Mon Sep 17 00:00:00 2001 From: 1ofoo Date: Mon, 16 Dec 2024 17:32:59 +0900 Subject: [PATCH 1/4] Fix: Fix mismatch between the output path of pkl files generated by create_data and the input path expected by subsequent processes. --- tools/create_data.py | 2 +- tools/dataset_converters/nuscenes_converter.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/create_data.py b/tools/create_data.py index d8c6495d6a..f6554a4eb5 100644 --- a/tools/create_data.py +++ b/tools/create_data.py @@ -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') diff --git a/tools/dataset_converters/nuscenes_converter.py b/tools/dataset_converters/nuscenes_converter.py index c53a2871f3..a58f7b66b2 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,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) From f50e1ef85d2c0a274aeadcc376a1d2d711e14094 Mon Sep 17 00:00:00 2001 From: 1ofoo Date: Mon, 16 Dec 2024 18:03:31 +0900 Subject: [PATCH 2/4] Style: lint --- tools/create_data.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/create_data.py b/tools/create_data.py index f6554a4eb5..e19dbc6251 100644 --- a/tools/create_data.py +++ b/tools/create_data.py @@ -74,7 +74,8 @@ def nuscenes_data_prep(root_path, Default: 10 """ nuscenes_converter.create_nuscenes_infos( - root_path, info_prefix, out_dir, 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') From d502587a72a5ea12225bb087d36f530e2d0785d1 Mon Sep 17 00:00:00 2001 From: 1ofoo Date: Mon, 16 Dec 2024 18:30:46 +0900 Subject: [PATCH 3/4] Style: lint --- tools/create_data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/create_data.py b/tools/create_data.py index e19dbc6251..d28d1746ec 100644 --- a/tools/create_data.py +++ b/tools/create_data.py @@ -74,7 +74,7 @@ def nuscenes_data_prep(root_path, Default: 10 """ nuscenes_converter.create_nuscenes_infos( - root_path, info_prefix, out_dir, + root_path, info_prefix, out_dir, version=version, max_sweeps=max_sweeps) if version == 'v1.0-test': From 876f5123010dbebf74c16687111b3038d5434b56 Mon Sep 17 00:00:00 2001 From: 1ofoo Date: Thu, 19 Dec 2024 10:26:00 +0900 Subject: [PATCH 4/4] Style: linter --- tools/create_data.py | 7 +++++-- tools/dataset_converters/nuscenes_converter.py | 6 ++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/tools/create_data.py b/tools/create_data.py index d28d1746ec..c920e0b1fa 100644 --- a/tools/create_data.py +++ b/tools/create_data.py @@ -74,8 +74,11 @@ def nuscenes_data_prep(root_path, Default: 10 """ nuscenes_converter.create_nuscenes_infos( - root_path, info_prefix, out_dir, - 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 a58f7b66b2..34112cee61 100644 --- a/tools/dataset_converters/nuscenes_converter.py +++ b/tools/dataset_converters/nuscenes_converter.py @@ -87,15 +87,13 @@ 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(out_dir, - '{}_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(out_dir, - '{}_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(out_dir,