Skip to content

hhuang-code/SinWavelet

Repository files navigation

A Single 3D Shape Wavelet-based Generative Model

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.

Primary dependencies

  • 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.

Pretrained models

We provide the pretrained models for Table 2 in our paper here. Downloading all of them needs about 1.7G storage space.

Data preparation

Download data

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.

Voxelize data

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.

Preprocessed data

We provide the preprocessed data used in our paper in \data folder.

Training

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}.

Generating

Before evaluation, we need to generate new shapes by running

bash scripts/generate.sh

Evaluation

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.

Export meshes

To export the generated shapes as mesh .obj files for visualization, run

bash vis_export.sh

Acknowledgement

Our code is built upon the repositories SingleShapeGen, DAG, and coulomb_gan. We would appreciate their authors.

Citation

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}
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published