You can find detailed usage instructions for training your own models and using pretrained models below.
If you find our code or paper useful, please consider citing
@inproceedings{PredictiveContextPriors,
title = {Surface Reconstruction from Point Clouds by Learning Predictive Context Priors},
author = {Baorui, Ma and Yu-Shen, Liu and Matthias, Zwicker and Zhizhong, Han},
booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
year = {2022}
}
This work was originally implemented by tensorflow, pytroch version of the code will be released soon that is easier to use.
Related work
Pytorch
https://github.com/mabaorui/NeuralPull-Pytorch
Tensorflow
https://github.com/mabaorui/NeuralPull
https://github.com/mabaorui/OnSurfacePrior
https://github.com/mabaorui/PredictableContextPrior
First you have to make sure that you have all dependencies in place. The simplest way to do so, is to use anaconda.
You can create an anaconda environment called tf
using
conda env create -f tf.yaml
conda activate tf
You should train the Local Context Prior Network first, run
python pcp.py --input_ply_file test.ply --data_dir ./data/ --CUDA 0 --OUTPUT_DIR_LOCAL ./local_net/ --OUTPUT_DIR_GLOBAL ./glocal_net/ --train --save_idx -1
You should put the point cloud file(--input_ply_file, only ply format) into the '--data_dir' folder.
Then train the Predictive Context Prior Network, run
python pcp.py --input_ply_file test.ply --data_dir ./data/ --CUDA 0 --OUTPUT_DIR_LOCAL ./local_net/ --OUTPUT_DIR_GLOBAL ./glocal_net/ --finetune --save_idx -1
You can extract the mesh model from the trained network, run
python pcp.py --input_ply_file test.ply --data_dir ./data/ --CUDA 0 --OUTPUT_DIR_LOCAL ./local_net/ --OUTPUT_DIR_GLOBAL ./glocal_net/ --test --save_idx -1
In different datasets or your own data, because of the variation in point cloud density, this '0.5' parameter has a very strong influence on the final result, which controls the distance between the query points and the point cloud. So if you want to get better results, you should adjust this parameter. We give '0.5' here as a reference value, and this value can be used for most object-level reconstructions. For the scene dataset, we will later publish the reference values for the hyperparameter settings for the scene dataset.