This is the official implementation for the paper "Occlusion Guided Self-supervised Scene Flow Estimation on 3D Point Clouds"
To run our model (3D-OGFlow), please install the following package (we suggest to use the Anaconda environment):
- Python 3.6+
- PyTorch==1.6.0
- CUDA CuDNN
- Pytorch-lightning==1.1.0
- numpy
- tqdm
Compile the furthest point sampling, grouping and gathering operation for PyTorch. We use the operation from this repo.
cd pointnet2
python setup.py install
cd ../
We use the Flyingthings3D and KITTI dataset preprocessed by this work.
Download the Flyingthings3D dataset from here and KITTI dataset from here.
Create a folder named datasets
under the root folder. After the downloading, extract the files into the datasets
. The directory of the datasets should looks like the following:
datasets/data_processed_maxcut_35_20k_2k_8192 % FlyingThings3D dataset
datasets/kitti_rm_ground % KITTI dataset
In order to train our model on the Flyingthings3D dataset with the supervised loss, run the following:
$ python train.py --num_points 8192 --batch_size 8 --epochs 120 --use_multi_gpu True
for the help on how to use the optional arguments, type:
$ python train.py --help
In order to train our model on the Flyingthings3D dataset by using our proposed self-supervised scheme, run the following:
$ python train_self_ln.py --num_points 8192 --batch_size 3 --epochs 150 --num_gpu 2
for the help on how to use the optional arguments, type:
$ python train_self_ln.py --help
Notice that in order to speed up the running time and to have a better utilization of the GPUs, our self-supervised training code is implemented using the PyTorch Lightning library.
We provide two pretained weights of 3D-OGFlow, one from the supervised training and the other from the self-supervised training. In order to evaluate our pretrained model under the pretrained_model
folder with the Flyingthings3D dataset, run the following:
$ python evaluate.py --num_points 8192 --dataset f3d --weight_path ./pretrained_model/supervised/PointPWOC_88.6285_114_0.1409.pth
for the evaluation on KITTI dataset, run the following:
$ python evaluate.py --num_points 8192 --dataset kitti --weight_path ./pretrained_model/supervised/PointPWOC_88.6285_114_0.1409.pth
For help on how to use this script, type:
$ python evaluate.py --help