Home

Awesome

Deep Geometric Prior for Surface Reconstruction

The reference implementaiton for the CVPR 2019 paper Deep Geometric Prior for Surface Reconstruction.

Code Overview

There are several programs in this repository explained in detail below. The documentation for each program can be seen by running it with the -h flag. The code is also extensively commented and should be easy to follow. Please create GitHub issues or reach out to me by email if you run into any problems.

Setting up and Running the Code

With conda (Recommended)

All dependencies can be automatically installed with conda using the provided environment.yml Simply run the following from the root of the repository:

conda env create -f environment.yml

This will create a conda environment named deep-surface-prior with all the correct dependencies installed. You can activate the environment by running:

conda activate deep-geometric-prior

Installing Dependencies Manually (Not Recommended)

If you are not using Conda, you can manually install the following dependencies:

Reducing Memory Usage

The Deep Geometric Prior trains an individual MLP for each surface patch in a model. Since there can be a lot of patches in a point cloud, this can lead to a high GPU memory usage when fitting all the MLPs in parallel. For this reason, we provide a --batch-size argument to reconstruct_surface.py which only fits --batch-size MLPs in parallel at once. If you run out of VRAM, try decreasing this parameter.

Surface Reconstruction Benchmark Data

The scans, ground truth data and reconstructions from the paper are available for download here.

The linked zip archive contains 3 directories:

Running the Deep Geometric Prior on the Surface Reconstruction Benchmark

python reconstruct_surface.py deep_geometric_prior_data/scans/gargoyle.ply 0.01 1.0 20 -d cuda:0 cuda:1 cuda:2 cuda:3 -nl 25 -ng 25 -o gargoyle

python reconstruct_surface.py deep_geometric_prior_data/scans/dc.ply 0.01 1.0 20 -d cuda:0 cuda:1 cuda:2 cuda:3 -nl 25 -ng 25 -o dc

python reconstruct_surface.py deep_geometric_prior_data/scans/lord_quas.ply 0.01 1.0 10 -d cuda:0 cuda:1 cuda:2 cuda:3 -nl 25 -ng 25 -o lord_quas

python reconstruct_surface.py deep_geometric_prior_data/scans/anchor.ply 0.01 1.0 10 -d cuda:0 cuda:1 cuda:2 cuda:3 -nl 25 -ng 25 -o anchor

python reconstruct_surface.py deep_geometric_prior_data/scans/daratech.ply 0.01 1.0 10 -d cuda:0 cuda:1 cuda:2 cuda:3 -nl 25 -ng 25 -o daratech   

NOTE: You may need to change the paths deep_geometric_prior_data/scans/*.ply to point to where you extracted the zip file, and you may need to change the device arguments -d cuda:0 ... to adapt to your system. To avoid CUDA out of memory error use the reconstruction in batches --batch-size.

Each of the above commands produces a ply file and pt file (e.g. anchor.ply, anchor.pt). The PLY file contains a dense upsampled point cloud and the PT file contains metadata about the reconstruction. You can use the PT file to perform further operations using example export_point_cloud.py.