MCPcopy Create free account
hub / github.com/AutonomousVehicleLaboratory/SemVecNet / nuscenes_data_prep

Function nuscenes_data_prep

SemVecNet/tools/create_data.py:52–90  ·  view source on GitHub ↗

Prepare data related to nuScenes dataset. Related data consists of '.pkl' files recording basic infos, 2D annotations and groundtruth database. Args: root_path (str): Path of dataset root. info_prefix (str): The prefix of info filenames. version (str): Dataset v

(root_path,
                       can_bus_root_path,
                       info_prefix,
                       version,
                       dataset_name,
                       out_dir,
                       max_sweeps=10)

Source from the content-addressed store, hash-verified

50
51
52def nuscenes_data_prep(root_path,
53 can_bus_root_path,
54 info_prefix,
55 version,
56 dataset_name,
57 out_dir,
58 max_sweeps=10):
59 """Prepare data related to nuScenes dataset.
60
61 Related data consists of '.pkl' files recording basic infos,
62 2D annotations and groundtruth database.
63
64 Args:
65 root_path (str): Path of dataset root.
66 info_prefix (str): The prefix of info filenames.
67 version (str): Dataset version.
68 dataset_name (str): The dataset class name.
69 out_dir (str): Output directory of the groundtruth database info.
70 max_sweeps (int): Number of input consecutive frames. Default: 10
71 """
72 nuscenes_converter.create_nuscenes_infos(
73 root_path, out_dir, can_bus_root_path, info_prefix, version=version, max_sweeps=max_sweeps)
74
75 if version == 'v1.0-test':
76 info_test_path = osp.join(
77 out_dir, f'{info_prefix}_infos_temporal_test.pkl')
78 nuscenes_converter.export_2d_annotation(
79 root_path, info_test_path, version=version)
80 else:
81 info_train_path = osp.join(
82 out_dir, f'{info_prefix}_infos_temporal_train.pkl')
83 info_val_path = osp.join(
84 out_dir, f'{info_prefix}_infos_temporal_val.pkl')
85 nuscenes_converter.export_2d_annotation(
86 root_path, info_train_path, version=version)
87 nuscenes_converter.export_2d_annotation(
88 root_path, info_val_path, version=version)
89 # create_groundtruth_database(dataset_name, root_path, info_prefix,
90 # f'{out_dir}/{info_prefix}_infos_train.pkl')
91
92
93def lyft_data_prep(root_path, info_prefix, version, max_sweeps=10):

Callers 1

create_data.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected