SDF-StyleGAN
SDF-StyleGAN copied to clipboard
SDF-StyleGAN: Implicit SDF-Based StyleGAN for 3D Shape Generation (SGP 2022)
This repository contains the core implementation of our paper:
SDF-StyleGAN: Implicit SDF-Based StyleGAN for 3D Shape Generation
Xin-Yang Zheng,
Yang Liu,
Peng-Shuai Wang,
Xin Tong.
Installation
Following is the suggested way to install the dependencies of our code:
conda create --name stylegan python=3.8
conda activate stylegan
conda install pytorch==1.8.0 torchvision==0.9.0 torchaudio==0.8.0 cudatoolkit=11.1 -c pytorch -c conda-forge
pip install fire scikit-image==0.18.2 scikit-learn==0.24.2 trimesh kornia==0.5.8 pyglet pyrender pyrr
pip install pytorch-lightning==1.5.1
Data Preparation
Data creation
Our SDF field training data was generated by following the pipepline described in the paper DualOctreeGNN. Please ref to its script for generating the SDF field from ShapeNet data or your customized data.
Preprocessed Data
Our training data is also available (total 165G+). Here is the link.
Usage
Train from Scratch
Please modify the data path in the scripts, then run
bash scripts/train_{DATA_CLASS}.sh
Shape Generation
We provide the pretrained models in here. You can download them and modify the model path in the scripts, then run
bash scripts/generate_{DATA_CLASS}.sh
Shading image based FID computation
You can try the demo that generates images for FID calculation. Please refer to our paper for more technical details.
python generate_for_fid.py --model_path {YOU_MODEL_PATH}
Acknowledgements
We use the following third-party codes.
- https://github.com/Hippogriff/rendering
- https://github.com/lucidrains/stylegan2-pytorch
- https://github.com/NVlabs/stylegan2-ada-pytorch
Citation
If you find our work useful in your research, please consider citing:
@inproceedings{zheng2022sdfstylegan,
title = {SDF-StyleGAN: Implicit SDF-Based StyleGAN for 3D Shape Generation},
author = {Zheng, Xin-Yang and Liu, Yang and Wang, Peng-Shuai and Tong, Xin},
booktitle = {Comput. Graph. Forum (SGP)},
year = {2022},
}