This repository contains the official source code and data for our paper:
A single 3D shape wavelet-based generative model or from Google Drive here
Computer & Graphics, 2024.
- Python 3.9+
- PyTorch 2.0+
- Cuda 11.8
- Trimesh 4.1
- PyWavelets 1.5
Or install dependencies with conda:
conda env create -f environment.yml
conda activate sinwavelet
# NOTE: The versions of the dependencies listed above are only for reference,
and please check https://pytorch.org/ for pytorch installation command for your CUDA version.
We provide the pretrained models for Table 2 in our paper here. Downloading all of them needs about 1.7G storage space.
A list of the sources for all shapes used in our paper can be found here: data/README.md, also as listed in Table 1 in our paper. Most of these shapes are free for download.
After downloading the shapes, make sure the variable BINVOX_PATH in voxelization/voxelize.py
is set to the path
of excetuable binvox. Then run our script
bash scripts/voxelize.sh
Change the bash command arguments as needed, and the processed data will be saved in .h5
format.
We provide the preprocessed data used in our paper in \data folder.
To train the model on the processed .h5 file, run
bash scripts/train.sh
Modify the other argument values as needed. By default, the log and model will be saved in checkpoints/{experiment-tag}
.
Before evaluation, we need to generate new shapes by running
bash scripts/generate.sh
To evaluate using metrics LP-IoU, LP-F-score, SSFID and Div, run
cd evaluation
bash eval.sh
As SSFID relies on a pretrained 3D shape classifiers, please download them
from here or
from here, and then put
Clsshapenet_128.pth
under evaluation
folder.
To export the generated shapes as mesh .obj files for visualization, run
bash vis_export.sh
Our code is built upon the repositories SingleShapeGen, DAG, and coulomb_gan. We would appreciate their authors.
If you find our repo useful for your research, please consider citing our paper:
@article{huang2024single,
title={A single 3D shape wavelet-based generative model},
author={Huang, Hao and Yuan, Shuaihang and Peng, Zheng and Hao, Yu and Wen, Congcong and Fang, Yi},
journal={Computers \& Graphics},
pages={103891},
year={2024},
publisher={Elsevier}
}