Convert the KITTI dataset to python!
The perfect afterparty ๐ for python aficionados ๐ working with the KITTI dataset ๐.
- Data as numpy arrays
- Visualization with matplotlib
Sample 2011_09_26_drive_0005 from the KITTI dataset.
Top: Camera data from the sample.
Bottom: Associated point cloud, car pose and trajectory in numpy & matplotlib (3D left and 2D right)
Create a new python environment with the associated requirements:
conda create --name kitti python=3.8.10
conda activate kitti
pip install -r requirements.txt
To ensure that Python paths are properly defined, update the ~/.bashrc
by adding the following lines
export AFTERKITTI_PATH=/path_to_afterKITTI
export PYTHONPATH=$PYTHONPATH:/$AFTERKITTI_PATH
You can convert any of the raw data provided in KITTI by following this procedure:
-
Convert raw data to ROS by using kitti2bag. When doing so, follow the instructions in this issue and move it to data/rosbags folder.
You can visualize the generated rosbags with the following commands (in separate terminals):
rosbag play -l data/rosbags/kitti_2011_09_26_drive_0005_synced.bag rosrun rviz rviz -d rviz_view.rviz
-
Convert ROS to Python by running:
python afterkitti/ros2python.py
This will generate a
pickle
file in the data/pickles folder. -
Import and visualize the dataset as follows:
python afterkitti/load_and_visualize.py