Running VoxelNet: End-to-End Learning for Point Cloud Based 3D Object Detection
Paper Overview
The paper can be found at: https://arxiv.org/abs/1711.06396
Code Execution
Multiple implementasions exist:
- A TensorFlow 2.0.0 implementation of VoxelNet.
- An unofficial TensorFlow version (selected here).
- A TensorFlow-based VoxelNet system for autonomous driving.
The chosen repository is: GitHub - qianguih/voxelnet
Environment Setup on autodl Server:
OS: Ubuntu 20.04 Python: 3.7
Create Conda Environment:
conda create -n voxelnet python=3.7
conda activate voxelnet
Install Dependencies:
pip3 install tensorflow==1.14.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
pip3 install easydict -i https://pypi.tuna.tsinghua.edu.cn/simple
pip3 install scikit-build -i https://pypi.tuna.tsinghua.edu.cn/simple
pip3 install opencv-python==3.4.3.18 -i https://pypi.tuna.tsinghua.edu.cn/simple
pip3 install llvmlite==0.32.1 -i https://pypi.tuna.tsinghua.edu.cn/simple
python3 -m pip install --upgrade --force pip
pip3 install matplotlib -i https://pypi.tuna.tsinghua.edu.cn/simple
pip3 install shapely -i https://pypi.tuna.tsinghua.edu.cn/simple
pip3 install numba -i https://pypi.tuna.tsinghua.edu.cn/simple
pip3 install Cython -i https://pypi.tuna.tsinghua.edu.cn/simple
Compile Cython Extension
python3 setup.py build_ext --inplace
Error Encountered:
Cannot open include file: 'numpy/arrayobject.h': No such file or directory
Solusion: Refer to: http://t.csdnimg.cn/abFlO
Compile Evaluation Script
cd kitti_eval
g++ -o evaluate_object_3d_offline evaluate_object_3d_offline.cpp
Error:
evaluate_object_3d_offline.cpp:12:10: fatal error: boost/numeric/ublas/matrix.hpp: No such file or directory
Fix:
sudo apt-get update
sudo apt-get install libboost-all-dev
Set Execution Permissions
chmod +x launch_test.sh
Data Preparation
Folder Structure
├── data
│ └── KITTI
│ ├── training
│ │ ├── calib
│ │ ├── image_2
│ │ ├── label_2
│ │ └── velodyne
│ ├── validation
│ │ ├── calib
│ │ ├── image_2
│ │ ├── label_2
│ │ └── velodyne
│ └── data_object_calib
│ ├── testing
│ │ └── calib
│ └── training
│ └── calib
Download instructions available in: Code Reproduction: VoxelNet Tensorflow Version (3D Detection) - CSDN Blog
Udpate Configuration Paths
Modify config.py:
__C.DATA_DIR = './data/KITTI'
__C.CALIB_DIR = './data/KITTI/data_object_calib/training/calib'
Modify Test Script
Update test.py to use a pre-trained vehicle model with visualization enabled:
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='testing')
parser.add_argument('-n', '--tag', type=str, nargs='?', default='pre_trained_car',
help='set log tag')
parser.add_argument('--output-path', type=str, nargs='?',
default='./predictions', help='results output dir')
parser.add_argument('-b', '--single-batch-size', type=int, nargs='?', default=2,
help='set batch size for each gpu')
parser.add_argument('-v', '--vis', type=bool, nargs='?', default=True,
help='set the flag to True if dumping visualizations')
Execute Test
python3 test.py
Results will be saved under ./predictions/vis
Evaluate Performance
./kitti_eval/evaluate_object_3d_offline data/KITTI/validation/label_2 ./predictions
Evaluation results will be stored in the predictions folder.