This is a toolkit for extracting elements (e.g. images, lasers and labels, which modified from offical dataset.proto defination to annotation.proto) from Waymo Open Dataset and visualizing the extracted images, laser points and labels with OpenCV and Mayavi
git clone https://github.com/DapengFeng/waymo-toolkit.git
cd waymo-toolkit
conda create -n waymo-toolkit python=3.7 vtk mayavi tabulate matplotlib numba scipy
conda activate waymo-toolkit
python setup.py install
/path/to/waymo_dataset
|---training
| |---*.tfrecord
|---validation
| |---*.tfrecord
|---testing
| |---*.tfrecord
- Extract all images
python tools/extract.py --source=/path/to/waymo_dataset --dest=/path/to/save_dir --type=all --image
- Extract all laser points
python tools/extract.py --source=/path/to/waymo_dataset --dest=/path/to/save_dir --type=all --laser
- Extract all labels and randomlly select 10% frames as the subset from the whole dataset. And I use the default random seed is 20200319, which is release date of waymo open dataset v1.2. You can change it to your own one, using the flag
--seed
python tools/extract.py --source=/path/to/waymo_dataset --dest=/path/to/save_dir --type=all --label --subset
After the above steps, you can see the script will generate the following folders in the /path/to/save_dir
. If you only want to extract the training data, you can change the flag --type=all
to --type=train
.
/path/to/save_dir
|---training
| |---image_0 (FRONT)
| |---image_1 (FRONT_LEFT)
| |---image_2 (FRONT_RIGHT)
| |---image_3 (SIDE_LEFT)
| |---image_4 (SIDE_RIGHT)
| |---laser (x,y,z)
| |---laser_r (range)
| |---laser_i (intensity)
| |---laser_e (elongation)
| |---label
| |---split.txt
|---validation
| |--- the same as training
|---testing
| |--- the same as training (except the split.txt)
python tools/visualize.py --source=/path/to/save_dir --image --project
python tools/visualize.py --source=/path/to/save_dir --image --box2d --project
python tools/visualize.py --source=/path/to/save_dir --image --box3d
python tools/visualize.py --source=/path/to/save_dir --laser
Waymo-Toolkit is released under the Apache 2.0 license.
If you use Waymo-Toolkit in your research, please use the following BibTeX entry.
@misc{feng2020waymo-toolkit,
author = {Dapeng Feng},
title = {Waymo-Toolkit},
howpublished = {\url{https://github.com/DapengFeng/waymo-toolkit}},
year = {2020}
}