Home

Awesome

<p align="center"> <h2 align="center"><strong>PCB-RandNet: Rethinking Random Sampling for LiDAR Semantic Segmentation in Autonomous Driving Scene</strong></h2> <p align="center"> <a href="https://scholar.google.com/citations?user=L39a9d8AAAAJ" target='_blank'>Huixian Cheng</a>,&nbsp; <a href="https://scholar.google.com/citations?user=4FaCTFgAAAAJ" target='_blank'>Xianfeng Han</a>,&nbsp; Hang Jiang, Dehong He, Guoqiang Xiao <br> College of Computer and Information Science, Southwest University<br> <a href="https://arxiv.org/abs/2209.13797">[arXiv]</a> </p> <div align="center"> <img src="assert/ppl.png"/> </div><br/>

Updates

Abstract

LiDAR point cloud sparsity and distance-dependent long-tailed distributions make Random Sampling less suitable for this scenario. To alleviate this problem, we propose Polar Cylinder Balanced Random Sampling (PCB-RS) and Sampling Consistency Loss (SCL) to optimize the point cloud distribution after down-sampling to improve the segmentation performance under different ranges (especially long range).

<div align="center"> <img src="assert/vis.png"/> </div><br/>

Environment Setup

Install python packages

conda env create -f my_env.yaml
conda activate randla

Note:

Compile C++ Wrappers

bash compile_op.sh

Prepare Data

Download SemanticKITTI from official web. Download SemanticPOSS from official web. Then preprocess the data:

python data_prepare_semantickitti.py
python data_prepare_semanticposs.py

Note:

Training

  1. Training baseline with RS or PCB-RS
python train_SemanticKITTI.py <args> 

python train_SemanticPOSS.py <args>

Options:
--backbone           select the backbone to be used: choices=['randla', 'baflac', 'baaf']
--checkpoint_path    path to pretrained models(if any), otherwise train from start
--log_dir            Name of the log dir
--max_epoch          max epoch for the model to run
--batch_size         training batch size, modify to full utilize the GPU/s
--val_batch_size     batch size for validation
--num_workers        number of workers for I/O
--sampling           select the sampling way: RS or PCB-RS. choices=['random', 'polar']
--seed               set random seed
--step               set length of dataset: 0 mean use all data || 4 mean use 1/4 dataset (Only use for SemanticKITTI)
--grid               resolution of polar cylinder
  1. Training model with PCB-RS and SCL
python train_both_SemanticKITTI.py <args>

python train_both_SemanticPOSS.py <args>

Options:  Similar to before.

Test

python test_SemanticKITTI.py <args>

python test_SemanticPOSS.py <args>

Options:
--infer_type         all: infer all points in specified sequence, sub: subsamples in specified sequence
--sampling           select the sampling way: RS or PCB-RS. choices=['random', 'polar']
--backbone           select the backbone to be used: choices=['randla', 'baflac', 'baaf']
--checkpoint_path    required. path to the model to test
--test_id            sequence id to test
--result_dir         result dir of predictions
--step               set length of dataset: 0 mean use all data || 4 mean use 1/4 dataset (Only use for SemanticKITTI)
--grid               resolution of polar cylinder

Note:

Other Utils

  1. Evaluation with Distances
python evaluate_DIS_SemanticKITTI.py <args>     ||      python evaluate_DIS_SemanticPOSS.py <args>
  1. Visualization
python visualize_SemanticKITTI.py <args>

This code is not used, so it has not been tested and may have bugs. If you want to use this code to visualize SemanticKITTI and SemanticPOSS, please refer to this repo and this repo.

  1. Others in tool.
caculate_time.py            Use to get Time Consumption Comparison between RS, PCB-RS, and FPS.
draw.py / draw_poss.py      Use to draw performance plot at different distances.
draw_vis_compare.py         Use to generate qualitative visualization and quantitative statistical analysis images between RS and PCB-RS similar to the paper.
eval_KITTI_gap.py           Use to calculate the difference in performance of the model under different sampling methods.
main_poss.py                Use to count distance distribution

Others to Note and Clarify

Pretrained Models and Logs:

KITTI ResultPOSS ResultAblation Study
Google DriveGoogle DriveGoogle Drive

Acknowledgement

Citation

If you find this work helpful, please consider citing our paper:

@article{cheng2022pcb,
  title={PCB-RandNet: Rethinking Random Sampling for LIDAR Semantic Segmentation in Autonomous Driving Scene},
  author={Cheng, Huixian and Han, XianFeng and Jiang, Hang and He, Dehong and Xiao, Guoqiang},
  journal={arXiv preprint arXiv:2209.13797},
  year={2022}
}