muzahidai / pdflow

PD-Flow: A Point Cloud Denoising Framework with Normalizing Flows (ECCV 2022)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PD-Flow: A Point Cloud Denoising Framework with Normalizing Flows

by Aihua Mao, Zihui Du, Yu-Hui Wen, Jun Xuan, and Yong-Jin Liu.

Introduction

Official code of our ECCV 2022 paper. [Paper & Supplement]

This work introduces a framework for point cloud denoising by incorporating normalizing flows.

Environment

First clone the code of this repo:

git clone --recursive https://github.com/unknownue/pdflow

Then other settings can be either configured manually or set up with docker.

Manual configuration

The code is implemented with CUDA 11.5, Python 3.8, PyTorch 1.11. Other require libraries:

Docker configuration

If you are familiar with Docker, you can use provided Dockerfile to configure all setting automatically.

Additional configuration

If you want to train the network, you also need to build the kernel of PytorchEMD like followings:

cd metric/PytorchEMD/
python setup.py install --user
cp build/lib.linux-x86_64-3.8/emd_cuda.cpython-38m-x86_64-linux-gnu.so .

Datasets

All training and evaluation data can be downloaded from repo of score-denoise and DMRDenoise. After downloading, place the extracted files into data directory as list in here.

We include a pretrained model in this repo.

Training & Denosing & Evaluation

Train the model as followings:

# train on PUSet, see train_deflow_score.py for tuning parameters
python models/deflow/train_deflow_score.py

# train on DMRSet, see train_deflow_dmr.py for tuning parameters
python models/deflow/train_deflow_dmr.py

Denoising a single point cloud as followings:

python models/deflow/denoise.py \
    --input=path/to/input.xyz \
    --output=path/to/output.xyz \
    --patch_size=1024 --niters=1 --ckpt=pretrain/pdflow-score-LCC.pt

Denoising point clouds in directory as followings:

python models/deflow/denoise.py \
    --input=path/to/input_directory \
    --output=path/to/output_directory \
    --patch_size=1024 --niters=1 --ckpt=pretrain/pdflow-score-LCC.pt

Evaluation:

# build executable to evaluate uniform, see build.sh for detail
bash eval/uniformity/build.sh
# evaluate all xyz files in a directory
python eval/eval2.py \
    --pred_dir=path/to/evaluation/directory \
    --off_dir=path/to/off_mesh/directory \
    --gt_dir=path/to/ground_truth/directory \
    --csv=path/to/evaluation/directory/result.csv

Reproduce Paper Results:

# PUSet dataset, 10K Points
python models/deflow/denoise.py --input=data/ScoreDenoise/examples/PUNet_10000_poisson_0.01 --output=evaluation/PU_10000_n0.01_i1 --patch_size=1024 --niters=1 --ckpt=pretrain/pdflow-score-LCC.pt
python models/deflow/denoise.py --input=data/ScoreDenoise/examples/PUNet_10000_poisson_0.02 --output=evaluation/PU_10000_n0.02_i1 --patch_size=1024 --niters=1 --ckpt=pretrain/pdflow-score-LCC.pt
python models/deflow/denoise.py --input=data/ScoreDenoise/examples/PUNet_10000_poisson_0.03 --output=evaluation/PU_10000_n0.03_i1 --patch_size=1024 --niters=2 --ckpt=pretrain/pdflow-score-LCC.pt
# PUSet dataset, 50K Points
python models/deflow/denoise.py --input=data/ScoreDenoise/examples/PUNet_50000_poisson_0.01 --output=evaluation/PU_50000_n0.01_i1 --patch_size=1024 --niters=1 --ckpt=pretrain/pdflow-score-LCC.pt
python models/deflow/denoise.py --input=data/ScoreDenoise/examples/PUNet_50000_poisson_0.02 --output=evaluation/PU_50000_n0.02_i1 --patch_size=1024 --niters=2 --first_iter_partition --ckpt=pretrain/pdflow-score-LCC.pt
python models/deflow/denoise.py --input=data/ScoreDenoise/examples/PUNet_50000_poisson_0.03 --output=evaluation/PU_50000_n0.03_i1 --patch_size=1024 --niters=2 --first_iter_partition --ckpt=pretrain/pdflow-score-LCC.pt

Citation

If this work is useful for your research, please consider citing:

@inproceedings{unknownue2022pdflow,
  title={PD-Flow: A Point Cloud Denoising Framework with Normalizing Flows},
  author={Mao, Aihua and Du, Zihui and Wen, Yu-Hui and Xuan, Jun and Liu, Yong-Jin},
  booktitle={The European Conference on Computer Vision (ECCV)},
  year={2022}
}

About

PD-Flow: A Point Cloud Denoising Framework with Normalizing Flows (ECCV 2022)

License:MIT License


Languages

Language:Python 77.6%Language:C++ 8.0%Language:Cuda 6.5%Language:Dockerfile 6.0%Language:Shell 1.3%Language:CMake 0.5%