/4D-PLS

4D Panoptic Lidar Segmentation

Primary LanguagePython

Tracking evaluation for SemanticKITTI

This repo contains code for the paper 4D Panoptic Lidar Segmentation. The code is based on the Pytoch implementation of KPConv.

Installation

git clone https://github.com/MehmetAygun/4D-PLS
cd 4D-PLS
pip install -r requirements.txt
cd cpp_wrappers
sh compile_wrappers.sh

Data

Create a directory data in main directory, download the SemanticKitti to there with labels from here

Also add semantic semantic-kitti.yaml file in SemanticKitti folder, you can download the file from here

Then create additional labels using utils/create_center_label.py,

python create_center_label.py

The data folder structure should be as follows:

data/SemanticKitti/
└── semantic-kitti.yaml
└── sequences/
    └── 08/
        └── poses.txt
        └── calib.txt
        └── times.txt
        └── labels
            ├── 000000.label
            ...
         └── velodyne
            ├── 000000.bin
            ...

Models

For saving models or using pretrained models create a folder named results in main directory. You can download a pre-trained model from here .

Training

For training, you should modify the config parameters in train_SemanticKitti.py. The most important thing that, to get a good performance train the model using config.pre_train = True firstly at least for 200 epochs, then train the model using config.pre_train = False.

python train_SemanticKitti.py

This code will generate config file and save the pre-trained models in the results directory.

Testing & Tracking

For testing, set the model directory the choosen_log in test_models.py, and modify the config parameters as you wish. Then run :

python test_models.py

This will generate semantic and instance predictions for small 4D volumes under the test/model_dir. To generate long tracks using small 4D volumes use stitch_tracklets.py

python stitch_tracklets.py --predictions test/model_dir --n_test_frames 4

This code will generate predictions in the format of SemanticKITTI under test/model_dir/stitch .

Evaluation

For getting the metrics introduced in the paper, use utils/evaluate_4dpanoptic.py

python evaluate_4dpanoptic.py --dataset=SemanticKITTI_dir --predictions=output_of_stitch_tracket_dir --data_cfg=semantic-kitti.yaml