All Projects → QhelDIV → ShapeFormer

QhelDIV / ShapeFormer

Licence: other
Official repository for the ShapeFormer Project

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects
Jupyter Notebook
11667 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to ShapeFormer

srVAE
VAE with RealNVP prior and Super-Resolution VAE in PyTorch. Code release for https://arxiv.org/abs/2006.05218.
Stars: ✭ 56 (-42.27%)
Mutual labels:  generative-model, representation-learning
NerfingMVS
[ICCV 2021 Oral] NerfingMVS: Guided Optimization of Neural Radiance Fields for Indoor Multi-view Stereo
Stars: ✭ 253 (+160.82%)
Mutual labels:  3d-reconstruction, 3dvision
Vae vampprior
Code for the paper "VAE with a VampPrior", J.M. Tomczak & M. Welling
Stars: ✭ 173 (+78.35%)
Mutual labels:  generative-model, representation-learning
RG-Flow
This is project page for the paper "RG-Flow: a hierarchical and explainable flow model based on renormalization group and sparse prior". Paper link: https://arxiv.org/abs/2010.00029
Stars: ✭ 58 (-40.21%)
Mutual labels:  generative-model, representation-learning
Curated List Of Awesome 3d Morphable Model Software And Data
The idea of this list is to collect shared data and algorithms around 3D Morphable Models. You are invited to contribute to this list by adding a pull request. The original list arised from the Dagstuhl seminar on 3D Morphable Models https://www.dagstuhl.de/19102 in March 2019.
Stars: ✭ 375 (+286.6%)
Mutual labels:  generative-model, 3d-reconstruction
Awesome Vaes
A curated list of awesome work on VAEs, disentanglement, representation learning, and generative models.
Stars: ✭ 418 (+330.93%)
Mutual labels:  generative-model, representation-learning
Variational Ladder Autoencoder
Implementation of VLAE
Stars: ✭ 196 (+102.06%)
Mutual labels:  generative-model, representation-learning
graphml-tutorials
Tutorials for Machine Learning on Graphs
Stars: ✭ 125 (+28.87%)
Mutual labels:  representation-learning
TailCalibX
Pytorch implementation of Feature Generation for Long-Tail Classification by Rahul Vigneswaran, Marc T Law, Vineeth N Balasubramaniam and Makarand Tapaswi
Stars: ✭ 32 (-67.01%)
Mutual labels:  representation-learning
pair2vec
pair2vec: Compositional Word-Pair Embeddings for Cross-Sentence Inference
Stars: ✭ 62 (-36.08%)
Mutual labels:  representation-learning
PaiConvMesh
Official repository for the paper "Learning Local Neighboring Structure for Robust 3D Shape Representation"
Stars: ✭ 19 (-80.41%)
Mutual labels:  3d-reconstruction
3D-Object-Reconstrution
A curated list of awesome Single-view 3D Object Reconstruction papers & resources
Stars: ✭ 75 (-22.68%)
Mutual labels:  3dvision
meta-embeddings
Meta-embeddings are a probabilistic generalization of embeddings in machine learning.
Stars: ✭ 22 (-77.32%)
Mutual labels:  representation-learning
GraphCNN-GAN
Graph-convolutional GAN for point cloud generation. Code from ICLR 2019 paper Learning Localized Generative Models for 3D Point Clouds via Graph Convolution
Stars: ✭ 50 (-48.45%)
Mutual labels:  generative-model
StructuredLight
Creating a 3D reconstruction of an object using multiple images
Stars: ✭ 42 (-56.7%)
Mutual labels:  3d-reconstruction
amr
Official adversarial mixup resynthesis repository
Stars: ✭ 31 (-68.04%)
Mutual labels:  representation-learning
favorite-research-papers
Listing my favorite research papers 📝 from different fields as I read them.
Stars: ✭ 12 (-87.63%)
Mutual labels:  generative-model
softpool
SoftPoolNet: Shape Descriptor for Point Cloud Completion and Classification - ECCV 2020 oral
Stars: ✭ 62 (-36.08%)
Mutual labels:  3d-reconstruction
adaptive-f-divergence
A tensorflow implementation of the NIPS 2018 paper "Variational Inference with Tail-adaptive f-Divergence"
Stars: ✭ 20 (-79.38%)
Mutual labels:  generative-model
Pose2vec
A Repository for maintaining various human skeleton preprocessing steps in numpy and tensorflow along with tensorflow model to learn pose embeddings.
Stars: ✭ 25 (-74.23%)
Mutual labels:  representation-learning

ShapeFormer: Transformer-based Shape Completion via Sparse Representation

vid_teaser_crop.mp4

Project Page | Paper (ArXiv) | Twitter thread

This repository is the official pytorch implementation of our paper, ShapeFormer: Transformer-based Shape Completion via Sparse Representation.

Xinggaung Yan1, Liqiang Lin1, Niloy Mitra2, Dani Lischinski3, Danny Cohen-Or4, Hui Huang1†
1Shenzhen University, 2University College London, 3Hebrew University of Jerusalem, 4Tel Aviv University

UPDATES

  • Core model code is released, please check core_code/README.md
  • The complete code is released! Please have a try!
  • (DFAUST) The data preprocess code for D-FAUST human shape is released!
  • Add Google Colab

Installation

The code is tested in docker enviroment pytorch/pytorch:1.6.0-cuda10.1-cudnn7-devel. The following are instructions for setting up the environment in a Linux system from scratch. You can also directly pull our provided docker environment: sudo docker pull qheldiv/shapeformer Or build the docker environment by yourself with the setup files in the Docker folder.

First, clone this repository with submodule xgutils. xgutils contains various useful system/numpy/pytorch/3D rendering related functions that will be used by ShapeFormer.

  git clone --recursive https://github.com/QhelDIV/ShapeFormer.git

Then, create a conda environment with the yaml file.

  conda env create -f environment.yaml
  conda activate shapeformer

Next, we need to install torch_scatter through this command

  pip install torch-scatter==2.0.7 -f https://data.pyg.org/whl/torch-1.7.0+cu101.html

Demo

First, download the pretrained model from this google drive URL and extract the content to experiments/

Then run the following command to test VQDIF. The results are in experiments/demo_vqdif/results

  python -m shapeformer.trainer --opts configs/demo/demo_vqdif.yaml --gpu 0 --mode "run"

Run the following command to test ShapeFormer for shape completion. The results are in experiments/demo_shapeformer/results

  python -m shapeformer.trainer --opts configs/demo/demo_shapeformer.yaml --gpu 0 --mode "run"

Dataset

We use the dataset from IMNet, which is obtained from HSP.

The dataset we adopted is a downsampled version (64^3) from these dataset (which is 256 resolution). Please download our processed dataset from this google drive URL. And then extract the data to datasets/IMNet2_64/.

To use the full resolution dataset, please first download the original IMNet and HSP datasets, and run the make_imnet_dataset function in shapeformer/data/imnet_datasets/imnet_datasets.py

D-FAUST Human Dataset

We also provide the scripts for process the D-FAUST human shapes. First, download the official D-FAUST dataset from this link and extract to datasets/DFAUST Then, execute the following lines to generate obj files and generate sdf samples for the human meshes.

  cd shapeformer/data/dfaust_datasets/datagen
  python generate_dfaust_obj_runfile.py
  bash generate_dfaust_obj_all.sh
  python generate_dfaust_sdf_samples.py

Usage

First, train VQDIF-16 with

  python -m shapeformer.trainer --opts configs/vqdif/shapenet_res16.yaml --gpu 0

After VQDIF is trained, train ShapeFormer with

  python -m shapeformer.trainer --opts configs/shapeformer/shapenet_scale.yaml --gpu 0

For testing, you just need to append --mode test to the above commands. And if you only want to run callbacks (such as visualization/generation), set the mode to run

There is a visualization callback for both VQDIF and ShapeFormer, who will call the model to obtain 3D meshes and render them to images. The results will be save in experiments/$exp_name$/results/$callback_name$/ The callbacks will be automatically called during training and testing, so to get the generation results you just need to test the model.

ALso notice that in the configuration files batch sizes are set to very small so that the model can run on a 12GB memory GPU. You can tune it up if your GPU has a larger memory.

Multi-GPU

Notice that to use multiple GPUs, just specify the GPU ids. For example --gpu 0 1 2 4 is to use the 0th, 1st, 2nd, 4th GPU for training. Inside the program their indices will be mapped to 0 1 2 3 for simplicity.

📔 Citation

If you find our work useful for your research, please consider citing the following papers :)

@misc{yan2022shapeformer,
      title={ShapeFormer: Transformer-based Shape Completion via Sparse Representation}, 
      author={Xingguang Yan and Liqiang Lin and Niloy J. Mitra and Dani Lischinski and Danny Cohen-Or and Hui Huang},
      year={2022},
      eprint={2201.10326},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}

📢: Shout-outs

The architecture of our method is inspired by ConvONet, Taming-transformers and DCTransformer. Thanks to the authors.

Also, make sure to check this amazing transformer-based image completion project(ICT)!

📧 Contact

This repo is currently maintained by Xingguang (@qheldiv) and is for academic research use only. Discussions and questions are welcome via [email protected].

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].