forked from traveller59/second.pytorch
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathcreate_data.py
37 lines (28 loc) · 1.2 KB
/
create_data.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import copy
from pathlib import Path
import pickle
import fire
import second.data.kitti_dataset as kitti_ds
import second.data.nuscenes_dataset as nu_ds
from second.data.all_dataset import create_groundtruth_database
def kitti_data_prep(root_path):
kitti_ds.create_kitti_info_file(root_path)
kitti_ds.create_reduced_point_cloud(root_path)
create_groundtruth_database("KittiDataset", root_path, Path(root_path) / "kitti_infos_train.pkl")
def nuscenes_data_prep(root_path, version, dataset_name, max_sweeps=10):
nu_ds.create_nuscenes_infos(root_path, version=version, max_sweeps=max_sweeps)
name = "infos_train.pkl"
if version == "v1.0-test":
name = "infos_test.pkl"
return
create_groundtruth_database(dataset_name, root_path, Path(root_path) / name)
if __name__ == '__main__':
import os
os.environ["MKL_NUM_THREADS"] = "24"
os.environ["NUMEXPR_NUM_THREADS"] = "24"
os.environ["OMP_NUM_THREADS"] = "24"
fire.Fire()
'''
Run this script as, from parent directory only:
python create_data.py nuscenes_data_prep --root_path=../../data/nuscenes/v1.0-mini --version="v1.0-mini" --dataset_name="NuScenesDataset" --max_sweeps=10
'''