- This PyTorch implementation of ArchiGAN, a research project conducted for generative form-finding based on 3D data. Code is based off of part of the paper "Learning a Probabilistic Latent Space of Object Shapes via 3D Generative-Adversarial Modeling". I provide the complete pipeline of loading dataset, training, evaluation and visualization here and also I would share some results based on different parameter settings.
- Python 3.6.5 | Anaconda
- Pytorch 0.4.1
- tensorboardX
- visdom (optional)
- 3D models were converted into obj files, that were then processed using
binvox-rw.py.
- Data was proprietary, and needs to be placed in a folder called
volumetric_data.
-
Then
cd src, simply runpython main.pyon GPU or CPU. Of course, you need a GPU for training until getting good results. I used one GeForce GTX 1070 in my experiments on 3D models with resolution of 32x32x32. The maximum number of channels of feature map is 256. Because of these, the results may be inconsistent with the paper. You may need a stronger one for higher resolution one 64x64x64 and 512 feature maps. -
Other arguments could be used, for example,
python main.py --logs=<SOMETHING_YOU_WANT_TO_LOG>would start the tensorboardX for logging tooutputsfolder. For local debugging, you can runpython main.py --local_test=True. -
During training, model weights and some 3D reconstruction images would be also logged to the
outputs,imagesfolders, respectively, for everymodel_save_stepnumber of step inparams.py. You can play with all parameters inparams.py.
- For evaluation for trained model, you can run
python main.py --test=Trueto calltester.py. - If you want to visualize using visdom, first run
python -m visdom.server, thenpython main.py --test=True --use_visdom=True. - For more results, see the following or the
resultsfolder.
- Here I list some basic parameter settings and in the results section I would change some specific parameters and see what happens.
- Batch size is 32, which depends on the memory and I do not see much difference by changing it.
- Learning rate, beta values for Adam and LeakyReLU parameters are the same with the original paper, as well as discriminator update trick based on accuracy.
- Latent z vector is sampled from normal(0, 0.33) following ganhacks, but I do not use soft labels in the basic setting.
- Sigmoid function is used at both generator and discriminator for final outputs.
- This code is a heavily modified version based on both 3DGAN-Pytorch and tf-3dgan and thanks for them.