Super Fast and Accurate 3D Object Detection based on 3D LiDAR Point Clouds (SFA3D)
Features
- Super fast and accurate 3D object detection based on LiDAR
- Fast training, fast inference
- An Anchor-free approach
- No Non-Max-Suppression
- Support distributed data parallel training
- Release pre-trained models
Highlights
- The technical details are described here
- The great introduction and explanation from
Computer Vision and Perception for Self-Driving Cars Course
Youtube link - SFA3D is used for the second course in the
Udacity Self-Driving Car Engineer Nanodegree Program: Sensor Fusion and Tracking
GitHub link
Update 2020.09.06: Add ROS
source code. The great work has been done by @AhmedARadwan.
The implementation is here
Demonstration (on a single GTX 1080Ti)
2. Getting Started
2.1. Requirement
The instructions for setting up a virtual environment is here.
git clone https://github.com/maudzung/SFA3D.git SFA3D
cd SFA3D/
pip install -r requirements.txt
2.2. Data Preparation
Download the 3D KITTI detection dataset from here.
The downloaded data includes:
- Velodyne point clouds (29 GB)
- Training labels of object data set (5 MB)
- Camera calibration matrices of object data set (16 MB)
- Left color images of object data set (12 GB) (For visualization purpose only)
Please make sure that you construct the source code & dataset directories structure as below.
2.3. How to run
2.3.1. Visualize the dataset
To visualize 3D point clouds with 3D boxes, let's execute:
cd sfa/data_process/
python kitti_dataset.py
2.3.2. Inference
The pre-trained model was pushed to this repo.
python test.py --gpu_idx 0 --peak_thresh 0.2
2.3.3. Making demonstration
python demo_2_sides.py --gpu_idx 0 --peak_thresh 0.2
The data for the demonstration will be automatically downloaded by executing the above command.
2.3.4. Training
2.3.4.1. Single machine, single gpu
python train.py --gpu_idx 0
2.3.4.2. Distributed Data Parallel Training
- Single machine (node), multiple GPUs
python train.py --multiprocessing-distributed --world-size 1 --rank 0 --batch_size 64 --num_workers 8
-
Two machines (two nodes), multiple GPUs
- First machine
python train.py --dist-url 'tcp://IP_OF_NODE1:FREEPORT' --multiprocessing-distributed --world-size 2 --rank 0 --batch_size 64 --num_workers 8
- Second machine
python train.py --dist-url 'tcp://IP_OF_NODE2:FREEPORT' --multiprocessing-distributed --world-size 2 --rank 1 --batch_size 64 --num_workers 8
Tensorboard
- To track the training progress, go to the
logs/
folder and
cd logs/<saved_fn>/tensorboard/
tensorboard --logdir=./
- Then go to http://localhost:6006/
Contact
If you think this work is useful, please give me a star!
If you find any errors or have any suggestions, please contact me (Email: [email protected]
).
Thank you!
Citation
@misc{Super-Fast-Accurate-3D-Object-Detection-PyTorch,
author = {Nguyen Mau Dung},
title = {{Super-Fast-Accurate-3D-Object-Detection-PyTorch}},
howpublished = {\url{https://github.com/maudzung/Super-Fast-Accurate-3D-Object-Detection}},
year = {2020}
}
References
[1] CenterNet: Objects as Points paper, PyTorch Implementation
[2] RTM3D: PyTorch Implementation
[3] Libra_R-CNN: PyTorch Implementation
The YOLO-based models with the same BEV maps input:
[4] Complex-YOLO: v4, v3, v2
3D LiDAR Point pre-processing:
[5] VoxelNet: PyTorch Implementation
Folder structure
${ROOT}
βββ checkpoints/
βββ fpn_resnet_18/
βββ fpn_resnet_18_epoch_300.pth
βββ dataset/
βββ kitti/
βββImageSets/
β βββ test.txt
β βββ train.txt
β βββ val.txt
βββ training/
β βββ image_2/ (left color camera)
β βββ calib/
β βββ label_2/
β βββ velodyne/
βββ testing/
β βββ image_2/ (left color camera)
β βββ calib/
β βββ velodyne/
βββ classes_names.txt
βββ sfa/
βββ config/
βΒ Β βββ train_config.py
βΒ Β βββ kitti_config.py
βββ data_process/
βΒ Β βββ kitti_dataloader.py
βΒ Β βββ kitti_dataset.py
βΒ Β βββ kitti_data_utils.py
βββ models/
βΒ Β βββ fpn_resnet.py
βΒ Β βββ resnet.py
βΒ Β βββ model_utils.py
βββ utils/
β βββ demo_utils.py
β βββ evaluation_utils.py
β βββ logger.py
β βββ misc.py
β βββ torch_utils.py
β βββ train_utils.py
β βββ visualization_utils.py
βββ demo_2_sides.py
βββ demo_front.py
βββ test.py
βββ train.py
βββ README.md
βββ requirements.txt