Fading Coder

One Final Commit for the Last Sprint

Home > Tech > Content

Running VoxelNet: End-to-End Learning for Point Cloud Based 3D Object Detection

Tech 1

Paper Overview

The paper can be found at: https://arxiv.org/abs/1711.06396

Code Execution

Multiple implementasions exist:

  1. A TensorFlow 2.0.0 implementation of VoxelNet.
  2. An unofficial TensorFlow version (selected here).
  3. 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.

Related Articles

Understanding Strong and Weak References in Java

Strong References Strong reference are the most prevalent type of object referencing in Java. When an object has a strong reference pointing to it, the garbage collector will not reclaim its memory. F...

Comprehensive Guide to SSTI Explained with Payload Bypass Techniques

Introduction Server-Side Template Injection (SSTI) is a vulnerability in web applications where user input is improper handled within the template engine and executed on the server. This exploit can r...

Implement Image Upload Functionality for Django Integrated TinyMCE Editor

Django’s Admin panel is highly user-friendly, and pairing it with TinyMCE, an effective rich text editor, simplifies content management significantly. Combining the two is particular useful for bloggi...

Leave a Comment

Anonymous

◎Feel free to join the discussion and share your thoughts.