This repository is the project for course Deep Generation Model. In this project, I try to reproduce IM-Net in pytorch and optimize the sampling and training process.
There are two sampling methods in this repo, baseline
is multi resolution training and soft_boundary
is soft boundary training process.
Install python package dependencies through pip:
pip install -r requirements.txt
We use dataset in PartNet and voxelize the shape in data
folder.
Before training the shape, you need to do the data sampling by
python data_processing.py
the sampling method in baseline
will generate a new folder processed_data
in the root path and another in soft_boundary
will generate soft_data
After sampling the shape, simply run
python main.py
CUDA_VISIBLE_DEVICES=0 python main.py # GPU user
Network structure
We define the test()
and visualization(number)
function in the main.py
, to use them, uncomment the following code in main function and
agent.test()
agent.visualization(5) # input the number of shape to visualize
comment agent.train()
, then run
python main.py
We define the interpolation
also in main.py
, to use it, uncomment agent.interpolation()
, to interpolate between specific shape, input the shape ID in dataset, like agent.interpolation(177, 1309)
We provide pretrained weight for test and interpolation. Download the weight and create a new folder weight
in the same path as main.py
, and put the weight into weight
.
Weight for baseline link
Weight for soft boundary link
We support tensorboard to visualize loss curves when training, run
tensorboard --logdir event --port 6008
and open the link localhost:16008
in explorer to see the training curves.
(a) is groundtruth, (b) is result of baseline, (c) is result of soft boundary, the noise is much less in soft boundary
Interpolation result, (a) is result of baseline, (b) is result of soft boundary, with smooth operation, the noise is filtered in (a). The detail is better in (b) in the third and fifth chairs (from left to right)
Thanks for Rundi Wu's help for this project. To cite IM-Net, please refer to link.