Skip to content

Latest commit

 

History

History
65 lines (57 loc) · 2.46 KB

NUSCENES_PREPROCESSING.md

File metadata and controls

65 lines (57 loc) · 2.46 KB

Download nuScenes dataset and convert it to KITTI format

Download nuScenes dataset from https://www.nuscenes.org/nuscenes#download and decompress it into NUSCENES_ROOT. Install nuScenes Dataset SDK (https://github.com/nutonomy/nuscenes-devkit) and some prerequisites:

pip install nuscenes-devkit
pip install pyquaternion fire matplotlib

We have been experimenting with v1.0 nuScenes dataset.

Convert the nuScenes dataset into KITTI format to NUSCENES_KITTI_FORMAT and NUSCENES_KITTI_FORMAT_20HZ by

cd data_processing/nuscenes
# nuScenes labels the LiDAR by 2Hz. We first extract the annotated portion
python nusc2kitti_boston.py --nusc_dir NUSCENES_ROOT --nusc_kitti_dir NUSCENES_KITTI_FORMAT

# then extract the full 20hz portion
python nusc2kitti_boston.py --nusc_dir NUSCENES_ROOT --nusc_kitti_dir NUSCENES_KITTI_FORMAT_20HZ --disable_convert_labels --disable_convert_images

[Optional] Obtain the train/test split

You can skip the following by directly using the uploaded files in data_preprocessing/nuscenes/meta_data/. We include the corresponding scripts to generate the splits as follows.

The train/test split of the traversals by their geo-location is generated by the following commands.

cd data_processing/nuscenes
python split_traintest.py --data_20hz_root NUSCENES_KITTI_FORMAT_20HZ

It will generate

data_preprocessing/nuscenes/meta_data/track_list.pkl
data_preprocessing/nuscenes/meta_data/valid_idx_info.pkl
data_preprocessing/nuscenes/meta_data/train_idx.txt # 3985 samples
data_preprocessing/nuscenes/meta_data/test_idx.txt # 2324 samples

Generate ground planes for detection training

cd data_processing
python RANSAC.py --calib_dir NUSCENES_KITTI_FORMAT/training/calib \
    --lidar_dir NUSCENES_KITTI_FORMAT/training/velodyne \
    --planes_dir NUSCENES_KITTI_FORMAT/training/planes --min_h 1.3 --max_h 2.0

Setup for detection training

Create soft links to nuscenes dataset:

cd downstream/OpenPCDet/data/nuscenes_boston
mkdir training
ln -s NUSCENES_KITTI_FORMAT/training/velodyne
ln -s NUSCENES_KITTI_FORMAT/training/label_2
ln -s NUSCENES_KITTI_FORMAT/training/calib
ln -s NUSCENES_KITTI_FORMAT/training/planes
ln -s NUSCENES_KITTI_FORMAT/training/image_2

After installing OpenPCDet, run

cd downstream/OpenPCDet/
python -m pcdet.datasets.kitti.kitti_dataset create_kitti_infos tools/cfgs/dataset_configs/nuscenes_boston.yaml True