ShapeNet Core with 55 categories (refered from FoldingNet.)
cd dataset
bash download_shapenet_core55_catagories.sh
cd dataset
bash download_modelnet40_same_with_pointnet.sh
cd dataset
bash download_shapenet_chair.sh
cd dataset
bash download_3dmatch.sh
The code has been tested with Python 3.6.9, PyTorch 1.2.0, CUDA 10.0 on Ubuntu 18.04.
To install the required python packages, run
pip install -r requirements.txt
To compile CUDA kernel for CD/EMD loss:
cd metrics_from_point_flow/pytorch_structural_losses/
make clean
make
For building the docker image simply run the following command in the root directory
docker build -f Dockerfile -t <tag> .
Available arguments for training an autoencoder
train.py [-h] [--config CONFIG] [--logdir LOGDIR]
[--data_path DATA_PATH] [--loss LOSS]
[--autoencoder AUTOENCODER]
optional arguments:
-h, --help show this help message and exit
--config CONFIG path to json config file
--logdir LOGDIR path to the log directory
--data_path DATA_PATH path to data for training
--loss LOSS loss function. One of [swd, msw, vsw, ebsw]
--autoencoder AUTOENCODER model name. One of [pointnet]
--f_type energy function type [exp, identity]
--estimation_type estimation of EBSWprivate [IS,SIR,IMH,RMH]
--gradient_type gradient estimator [independent (copy), normal (reinforce)]
--inter_dim dimension of keys
--proj_dim projected dimension in linformer
--kappa scale of vMF distribution
Example
python3 train.py --config="config.json" \
--logdir="logs/" \
--data_path="dataset/shapenet_core55/shapenet57448xyzonly.npz" \
--loss="swd" \
--autoencoder="pointnet"
# or in short, you can run
bash train.sh
To test reconstruction
python3 reconstruction/reconstruction_test.py --config="reconstruction/config.json" \
--logdir="logs/" \
--data_path="dataset/modelnet40_ply_hdf5_2048/"
# or in short, you can run
bash reconstruction/test.sh
To render input and reconstructed point-clouds, please follow the instruction in render/README.md
to install dependencies. To reproduce Figure 4 in our paper, run the following commands after training all autoencoders
python3 save_point_clouds.py
cd render
bash render_reconstruction.sh
cd ..
python3 concat_reconstructed_images.py
The structure of this repo is largely based on PointSWD. The structure of folder render
is largely based on Mitsuba2PointCloudRenderer. We are very grateful for their open sources.