Home

Awesome

RandLA-Net-pytorch

This repository contains the implementation of RandLA-Net (CVPR 2020 Oral) in PyTorch.

Updates:

Previous:

Performance

Results on Validation Set (seq 08)

ModelmIoU
Original Tensorflow0.531
Our Pytorch Implementation0.551
mIoUcarbicyclemotorcycletruckother-vehiclepersonbicyclistmotorcyclistroadparkingsidewalkother-groundbuildingfencevegetationtrunkterrainpoletraffic-sign
55.10.9390.0920.3470.6590.4530.5480.7070.0000.9200.4010.7840.0060.8860.5200.8550.6270.7470.5680.403

A. Environment Setup

  1. Click this webpage and use conda to install pytorch>=1.4 (Be aware of the cuda version when installation)

  2. Install python packages

pip install -r requirements.txt
  1. Compile C++ Wrappers
sh compile_op.sh

B. Prepare Data

Download the Semantic KITTI dataset, and preprocess the data:

python data_prepare_semantickitti.py --src_path path/to/sequences --dst_path destination/for/preprocessed/sequences

Note:

C. Training & Testing

  1. Training
python3 train_SemanticKITTI.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, the file will be in logs/ suffixed with start time
--max_epoch          max epoch for the model to run, default 80
--batch_size         training batch size, default 6 (indicated in oroginal implementation), modify to full utilize the GPU/s
--val_batch_size     batch size for validation, default 30
--num_workers        number of workers for I/O
--focal              whether to use focal loss or not, default True
--focal_gamma        gamma for focal loss, default 2

  1. Testing
python3 test_SemanticKITTI.py <args>
Options:
--backbone           select the backbone to be used: choices=['randla', 'baflac', 'baaf']
--infer_type         all: infer all points in specified sequence, sub: subsamples in specified sequence
--checkpoint_path    required. path to the model to test
--test_id            sequence id to test
--index_to_label     whether to convert .npy(label 0-19) back .label(original labels)

Note: if the flag --index_to_label is set, output predictions will be ".label" files (label figure) which can be visualized; Otherwise, they will be ".npy" (0-19 index) files which is used to evaluated afterward.

D. Visualization & Evaluation

  1. Visualization
python3 visualize_SemanticKITTI.py <args>

options:

--dataset path to dataset for visualization

--config dataset config, default utils/semantic-kitti.yaml

--sequence sequence to visualize

--predictions location for predictions
  1. Evaluation
python3 evaluate_SemanticKITTI.py --dataset /tmp2/tsunghan/PCL_Seg_data/sequences_0.06/ \
    --predictions runs/supervised/predictions/ --sequences 8

Acknowledgement