Neural-Pull: Learning Signed Distance Functions from Point Clouds by Learning to Pull Space onto Surfaces(ICML 2021)

Overview

Neural-Pull: Learning Signed Distance Functions from Point Clouds by Learning to Pull Space onto Surfaces(ICML 2021)

This repository contains the code to reproduce the results from the paper. Neural-Pull: Learning Signed Distance Functions from Point Clouds by Learning to Pull Space onto Surfaces.

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{NeuralPull,
    title = {Neural-Pull: Learning Signed Distance Functions from Point Clouds by Learning to Pull Space onto Surfaces},
    author = {Baorui, Ma and Zhizhong, Han and Yu-shen, Liu and Matthias, Zwicker},
    booktitle = {International Conference on Machine Learning (ICML)},
    year = {2021}
}

Surface Reconstruction Demo

Single Image Reconstruction Demo

Installation

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 tensorflow1 using

conda env create -f NeuralPull.yaml
conda activate tensorflow1

Next, for evaluation of the models,compile the extension modules, which are provided by Occupancy Networks. You can do this via

python setup.py build_ext --inplace

To compile the dmc extension, you have to have a cuda enabled device set up. If you experience any errors, you can simply comment out the dmc_* dependencies in setup.py. You should then also comment out the dmc imports in im2mesh/config.py.

Dataset and pretrained model

  1. You can download our preprocessed data and pretrained model.Included in the link:

    --Our pre-train model on ABC and FAMOUS dataset.

    --Preprocessing data of ABC and FAMOUS(sample points and ground truth points).

    --Our reconstruction results.

  2. To make it easier for you to test the code, we have prepared exmaple data in the exmaple_data folder.

Building the dataset

Alternatively, you can also preprocess the dataset yourself. To this end, you have to follow the following steps:

  • Put your own pointcloud files in 'input_dir' folder, each pointcloud file in a separate .xyz.npy file.
  • Set an empty folder 'out_dir' to place the processed data, note, the folder need to be empty, because this folder will be deleted before the program runs.

You are now ready to build the dataset:

python sample_query_point --out_dir /data1/mabaorui/AtlasNetOwn/data/plane_precompute_2/ --CUDA 0 --dataset other --input_dir ./data/abc_noisefree/04_pts/ 

Training

You can train a new network from scratch, run

  1. Surface Reconstruction
python NeuralPull.py --data_dir /data1/mabaorui/AtlasNetOwn/data/plane_precompute_2/ --out_dir /data1/mabaorui/AtlasNetOwn/plane_cd_sur/ --class_idx 02691156 --train --dataset shapenet
  1. Single Image Reconstruction
python NeuralPull_SVG.py --data_dir /data1/mabaorui/AtlasNetOwn/data/plane_precompute_2/ --out_dir /data1/mabaorui/AtlasNetOwn/plane_cd_sur/ --class_idx 02691156 --train --class_name plane
  1. Train the dataset yourself
python NeuralPull.py --data_dir /data1/mabaorui/AtlasNetOwn/data/plane_precompute_2/ --out_dir /data1/mabaorui/AtlasNetOwn/plane_cd_sur/ --class_idx 02691156 --train --dataset other

Evaluation

For evaluation of the models and generation meshes using a trained model, use

  1. Surface Reconstruction
python NeuralPull.py --data_dir /data1/mabaorui/AtlasNetOwn/data/plane_precompute_2/ --out_dir /data1/mabaorui/AtlasNetOwn/plane_cd_sur/ --class_idx 02691156 --dataset shapenet
  1. Single Image Reconstruction
python NeuralPull_SVG.py --data_dir /data1/mabaorui/AtlasNetOwn/data/plane_precompute_2/ --out_dir /data1/mabaorui/AtlasNetOwn/plane_cd_sur/ --class_idx 02691156 --class_name plane
  1. Evaluation the dataset yourself
python NeuralPull.py --data_dir /data1/mabaorui/AtlasNetOwn/data/plane_precompute_2/ --out_dir /data1/mabaorui/AtlasNetOwn/plane_cd_sur/ --class_idx 02691156 --dataset other

Script Parameters Explanation

Parameters Description
train train or test a network.
data_dir preprocessed data.
out_dir store network parameters when training or to load pretrained network parameters when testing.
class_idx the class to train or test when using shapenet dataset, other dataset, default.
class_name the class to train or test when using shapenet dataset, other dataset, default.
dataset shapenet,famous,ABC or other(your dataset)

Pytorch Implementation of Neural-Pull

Notably, the code in Pytorch implementation is not released by the official lab, it is achieved by @wzxshgz123's diligent work. His intention is only to provide references to researchers who are interested in Pytorch implementation of Neural-Pull. There is no doubt that his unconditional dedication should be appreciated.

Comments
  • questions about surface Reconstruction

    questions about surface Reconstruction

    Hi, Recently, I have read the pytorch code of your work,but I canot fully understand how to reconstrcut surface. According to code,It doesnot use any information in GT_mesh and even the query_point is random generated. How to make sure that our generated mesh can correspond to GT_mesh one by one? Could you please answer my question?Thank you so much !

    opened by QtEngineer 10
  • About dataset for surface reconstruction

    About dataset for surface reconstruction

    Dear baorui,

    Thansk for sharing your great work! From my understanding, for the surface reconstruction experiments, we need one network for each shape. And the Tab.1 and Tab 2 show the metric in ABC, FAMOUS dataset and ShapeNet. I want to make sure whether you just use the test part of these dataset ( ABC, FAMOUS dataset and ShapeNet) for the evaluation?

    looking for your reply!

    Best, Runsong

    opened by Runsong123 10
  • Thanks very much..

    Thanks very much..

    Thanks very much.. I have made as you say for the first 2 command lines, and as result, I have 3 environments, the first is base for anaconda, the second is env for the first line of command, the last one is called TensorFlow for the second command line. Now I'm facing another problem in the third command line which is 'python setup.py build_ext --inplace', I have implemented it in the env. of the first command, is that right or I'm in the wrong direction? the error that I have is like WhatsApp Image 2021-07-27 at 2 01 30 AM the photo is attached below, could you help me, please? thanks for your efforts. Heyam

    Originally posted by @HeyamM in https://github.com/mabaorui/NeuralPull/issues/2#issuecomment-887088549

    opened by HeyamM 7
  • Question about the quantitative comparison under the dataset released by Points2Surf

    Question about the quantitative comparison under the dataset released by Points2Surf

    Dear Baorui,

    First of all, I show my appreciation to you for your Neural-Pull code. But I found that under the dataset released by Points2Surf such as FAMOUS no-noise dataset, the produced chamfer-distance results of your method are inconsistent with Table 1 in the main paper. I used the evaluation code released by Points2Surf.

    | Chamfer | Points2Surf(Ori Paper) | Points2Surf(My result) | Neural-Pull(Your Paper) | Neural-Pull (My result) | | :-------------: | :----------------: | :---------------: | :----------------: | :--------------: | | FAMOUS no-noise | 1.41 | 1.46 | 0.22 | 3.41 |

    I have no idea what happened. Could you help me? Thank you very much!

    P.S. I only found the chamfer-distance formulation defined by occupancy_networks in your code, and I haven't seen the chamfer-distance formulation of Points2Surf. Based on my understanding, the chamfer distance defined by occupancy_networks and Points2Surf is different (ErlerPhilipp/points2surf#20). I guess that it may need to utilize the chamfer-distance formulation given by Points2Surf to evaluate rec results under the dataset released by Points2Surf for fairness, just like POCO doing.

    So do you think the statistics in your paper are a little misleading?

    Best

    https://github.com/mabaorui/NeuralPull/blob/c093a52308a9b74446d24cc6c1b0fee5ee5bb7bb/NeuralPull.py#L92-L139

    opened by bearprin 4
  • conflicts in `conda env create -f NeuralPull.yaml`

    conflicts in `conda env create -f NeuralPull.yaml`

    Full log:

     conda env create -f NeuralPull.yaml                                                                           
    
    Collecting package metadata (repodata.json): done
    Solving environment: failed
    
    ResolvePackageNotFound:
      - python==2.7.12=1
      - tk==8.5.18=0
      - readline==6.2=2
      - qt==5.6.2=5
      - sqlite==3.13.0=0
      - fontconfig==2.12.1=3
      - pillow==4.2.1=py27_0
      - cairo==1.14.8=0
      - matplotlib==2.0.2=np113py27_0
      - freetype==2.5.5=2
      - icu==54.1=0
      - libiconv==1.14=0
      - cudatoolkit==8.0=3
    

    Hi @mabaorui, I have got some cycles to test the code :)

    I am going around this issue by removing the version constraints on these packages but it would be great to have an official YAML that works because now i won't know if any subsequent issue come from a bad package version or something else,

    Best regards, Thibault

    opened by ThibaultGROUEIX 4
  • Surface reconstruction

    Surface reconstruction

    Hi,

    Thanks a lot for the code release, I greatly enjoyed your paper. I would like to experiment with surface reconstruction on my own pointclouds and ran into a few issues.

    As per my understanding from your pape, NeuralPull does not condition the surface reconstruction on anything :

    We do not leverage any condition c in Fig. 1 and overfit the neural network
    to the shape by minimizing the loss in Eq. 2
    

    However, the surface reconstruction script seems to be conditioning the reconstruction on a code, and learning surface reconstruction jointly?

    Ideally, to test NeuralPull, it would be great if the repo included a script that takes a pointcloud as input, fits neuralPull and returns a mesh.

    I am sorry if I misunderstood the code and thanks a lot for your help,

    Thibault

    opened by ThibaultGROUEIX 4
  • Single View Reconstruction Experiment

    Single View Reconstruction Experiment

    Hi Baorui,

    I have some questions regarding this experiment presented in Section 4.2, hope you can help me with this.

    1. Is the L1 CD metric reported in Table 7 multiplied by a constant factor of 0.5, as shown here?
    2. Is there any (additional) normalization applied on the point clouds obtained from the Occupancy Networks ShapeNet dataset for training & evaluation respectively? If not, does that mean the point clouds are bounded within a unit cube centered at 0 with a padding of 0.05 on all sides?
    3. Is it true that only the first view for every object in the dataset is used for evaluation, as done in Occupancy Networks?

    Thanks!

    opened by low5545 2
  • Make a shadertoy rendering from output

    Make a shadertoy rendering from output

    Hi, I was wondering how to extract one possible sdf array so I can render it and use it for data base search?

    Siren made a good demo. https://www.shadertoy.com/view/wtVyWK I wanted to do the same to NeuralPull.

    opened by fire 2
  • Threshold for surface reconstruction

    Threshold for surface reconstruction

    Hi @mabaorui,

    Congrats again and sorry for the repeated queries. I am still trying to figure out a few aspects of the method and am thus opening various discussions, I hope that is ok.

    I have been experimenting for surface reconstruction using the Pytorch version of the code. As you know : bearprin/neuralpull-pytorch#2

    I observe that the results are better with a threshold of 0.005 than 0. Some large chunks of the shapes are sometimes not reconstructed with a threshold of 0.

    Does this mean that the fitted SDF has converged to an unsigned distance function?

    Thanks a lot, Thibault

    opened by ThibaultGROUEIX 2
  • Stability in the results for surface reconstruction

    Stability in the results for surface reconstruction

    Hi @mabaorui,

    Congrats again and sorry for the repeated queries. I am still trying to figure out a few aspects of the method and am thus opening various discussions, I hope that is ok.

    I have been experimenting for surface reconstruction using the Pytorch version of the code. As you know : https://github.com/bearprin/neuralpull-pytorch/issues/2

    I observe that the results are not very stable aven after a long time of overfitting a single shape. I can pick a good reconstruction by selecting a step where the fitted mesh is close to the input pointcloud with an ad-hoc metric (like L1 or L2 or Hausdorff), but the next step might be a poor reconstruction.

    I wonder if this instability is a bug or a normal behaviour of the method?

    Thanks a lot, Thibault

    opened by ThibaultGROUEIX 2
  • Higher-order gradient

    Higher-order gradient

    Hi @mabaorui,

    Congrats again and sorry for the repeated queries. I am still trying to figure out a few aspects of the method and am thus opening various discussions, I hope that is ok.

    I wonder if you use higher-order gradients to backprop in equation 1 of the main paper. I noticed that the pytorch version does not use higher order gradients. And I have hardly ever used Tensorflow in my life, so it is hard for me to understand the official code.

    Beside the answer, I wonder what are the pros and cons of using higher-order gradients in this equation, and how you made this design decision,

    Thanks a lot, Thibault

    opened by ThibaultGROUEIX 2
  • Data for Single-view Reconstruction

    Data for Single-view Reconstruction

    Hi @mabaorui, thanks for your code. I'm interested in the single-view reconstruction part and I want to train it on new data. But before that I want to reproduce it.

    I noticed that the image features are pre-extracted by a pre-trained model from SoftRas as you mentioned in the issue #4. But they released three models with silhouettes supervision, with shading supervision and with color supervision. Which one was used here? Or could you provide the image feature data here if possible? Thank you again.

    opened by Wi-sc 1
Owner
null
Official implementation of "MetaSDF: Meta-learning Signed Distance Functions"

MetaSDF: Meta-learning Signed Distance Functions Project Page | Paper | Data Vincent Sitzmann*, Eric Ryan Chan*, Richard Tucker, Noah Snavely Gordon W

Vincent Sitzmann 100 Jan 1, 2023
Learning Continuous Signed Distance Functions for Shape Representation

DeepSDF This is an implementation of the CVPR '19 paper "DeepSDF: Learning Continuous Signed Distance Functions for Shape Representation" by Park et a

Meta Research 1.1k Jan 1, 2023
Implementation of CVPR'2022:Reconstructing Surfaces for Sparse Point Clouds with On-Surface Priors

Reconstructing Surfaces for Sparse Point Clouds with On-Surface Priors (CVPR 2022) Personal Web Pages | Paper | Project Page This repository contains

null 151 Dec 26, 2022
Code for "PV-RAFT: Point-Voxel Correlation Fields for Scene Flow Estimation of Point Clouds", CVPR 2021

PV-RAFT This repository contains the PyTorch implementation for paper "PV-RAFT: Point-Voxel Correlation Fields for Scene Flow Estimation of Point Clou

Yi Wei 43 Dec 5, 2022
Not All Points Are Equal: Learning Highly Efficient Point-based Detectors for 3D LiDAR Point Clouds (CVPR 2022, Oral)

Not All Points Are Equal: Learning Highly Efficient Point-based Detectors for 3D LiDAR Point Clouds (CVPR 2022, Oral) This is the official implementat

Yifan Zhang 259 Dec 25, 2022
This project is the official implementation of our accepted ICLR 2021 paper BiPointNet: Binary Neural Network for Point Clouds.

BiPointNet: Binary Neural Network for Point Clouds Created by Haotong Qin, Zhongang Cai, Mingyuan Zhang, Yifu Ding, Haiyu Zhao, Shuai Yi, Xianglong Li

Haotong Qin 59 Dec 17, 2022
Hand-distance-measurement-game - Hand Distance Measurement Game

Hand Distance Measurement Game This is program is made to calculate the distance

Priyansh 2 Jan 12, 2022
Code Release for ICCV 2021 (oral), "AdaFit: Rethinking Learning-based Normal Estimation on Point Clouds"

AdaFit: Rethinking Learning-based Normal Estimation on Point Clouds (ICCV 2021 oral) **Project Page | Arxiv ** Runsong Zhu¹, Yuan Liu², Zhen Dong¹, Te

null 40 Dec 30, 2022
Code for the paper "Spatio-temporal Self-Supervised Representation Learning for 3D Point Clouds" (ICCV 2021)

Spatio-temporal Self-Supervised Representation Learning for 3D Point Clouds This is the official code implementation for the paper "Spatio-temporal Se

Hesper 63 Jan 5, 2023
Code for the paper SphereRPN: Learning Spheres for High-Quality Region Proposals on 3D Point Clouds Object Detection, ICIP 2021.

SphereRPN Code for the paper SphereRPN: Learning Spheres for High-Quality Region Proposals on 3D Point Clouds Object Detection, ICIP 2021. Authors: Th

Thang Vu 15 Dec 2, 2022
Public repository of the 3DV 2021 paper "Generative Zero-Shot Learning for Semantic Segmentation of 3D Point Clouds"

Generative Zero-Shot Learning for Semantic Segmentation of 3D Point Clouds Björn Michele1), Alexandre Boulch1), Gilles Puy1), Maxime Bucher1) and Rena

valeo.ai 15 Dec 22, 2022
《A-CNN: Annularly Convolutional Neural Networks on Point Clouds》(2019)

A-CNN: Annularly Convolutional Neural Networks on Point Clouds Created by Artem Komarichev, Zichun Zhong, Jing Hua from Department of Computer Science

Artёm Komarichev 44 Feb 24, 2022
This is the code repository implementing the paper "TreePartNet: Neural Decomposition of Point Clouds for 3D Tree Reconstruction".

TreePartNet This is the code repository implementing the paper "TreePartNet: Neural Decomposition of Point Clouds for 3D Tree Reconstruction". Depende

刘彦超 34 Nov 30, 2022
A colab notebook for training Stylegan2-ada on colab, transfer learning onto your own dataset.

Stylegan2-Ada-Google-Colab-Starter-Notebook A no thrills colab notebook for training Stylegan2-ada on colab. transfer learning onto your own dataset h

Harnick Khera 66 Dec 16, 2022
Official Code for ICML 2021 paper "Revisiting Point Cloud Shape Classification with a Simple and Effective Baseline"

Revisiting Point Cloud Shape Classification with a Simple and Effective Baseline Ankit Goyal, Hei Law, Bowei Liu, Alejandro Newell, Jia Deng Internati

Princeton Vision & Learning Lab 115 Jan 4, 2023
(CVPR 2021) PAConv: Position Adaptive Convolution with Dynamic Kernel Assembling on Point Clouds

PAConv: Position Adaptive Convolution with Dynamic Kernel Assembling on Point Clouds by Mutian Xu*, Runyu Ding*, Hengshuang Zhao, and Xiaojuan Qi. Int

CVMI Lab 228 Dec 25, 2022
(CVPR 2021) Back-tracing Representative Points for Voting-based 3D Object Detection in Point Clouds

BRNet Introduction This is a release of the code of our paper Back-tracing Representative Points for Voting-based 3D Object Detection in Point Clouds,

null 86 Oct 5, 2022
Code for Iso-Points: Optimizing Neural Implicit Surfaces with Hybrid Representations

Implementation for Iso-Points (CVPR 2021) Official code for paper Iso-Points: Optimizing Neural Implicit Surfaces with Hybrid Representations paper |

Yifan Wang 66 Nov 8, 2022
[ICCV'21] UNISURF: Unifying Neural Implicit Surfaces and Radiance Fields for Multi-View Reconstruction

UNISURF: Unifying Neural Implicit Surfaces and Radiance Fields for Multi-View Reconstruction Project Page | Paper | Supplementary | Video This reposit

null 331 Dec 28, 2022