PyTorch implementation for the paper Denoise and Contrast for Category Agnostic Shape Completion (CVPR 2021.).
Repository still under construction/refactoring. In case of any issue feel free to email me at antonio.alliegro@polito.it
# Create and activate a new conda environment
conda create --name deco_env python=3.7.9
conda activate deco_env
./install_requirements.sh
Due to incompatibility between PyTorch and Open3D it is mandatory to import first Open3d and then PyTorch. If you encounter script crash (free(): invalid pointer) at the beginning of the training you probably swapped the imports (https://github.com/pytorch/pytorch/issues/19739).
Moreover, to compile the chamfer module some variables referring to CUDA/CUDNN installation must be exported. Check the install_requirements script to verify that the paths in there match your local CUDA installation folder.
You can use the download_dataset.sh script to download ShapenetPart dataset.
Some example of training scripts
# Train Deco: Denoise and Contrast Pretexts, w/ Frame Regularization
python train_deco.py --data_root data/shapenetcore_partanno_segmentation_benchmark_v0 --exp_name deco1280_512_wFrame512_sn13 --config configs/deco_config.json --parallel -P1 1280 -P2 512 --raw_weight 1
# Others:
# Train Deco: Denoise and Contrast Pretexts, w/o Frame Regularization
python train_deco.py --data_root data/shapenetcore_partanno_segmentation_benchmark_v0 --exp_name deco1280_512_noFrame_sn13 --config configs/deco_config.json --parallel -P1 1280 -P2 512 --raw_weight 0
# train: w/o Denoise and Contrast Pretexts, w/ Frame Regularization
# no pretexts at all
python train_deco.py --data_root data/shapenetcore_partanno_segmentation_benchmark_v0 --exp_name noPretexts1280_512_wFrame512_sn13 --config configs/noPretexts_config.json --parallel -P1 1280 -P2 512 --raw_weight 1
# train: w/o Denoise and Contrast Initialization, w/o Frame Regularization
# no pretexts at all
python train_deco.py --data_root data/shapenetcore_partanno_segmentation_benchmark_v0 --exp_name noPretexts1280_512_noFrame_sn13 --config configs/noPretexts_config.json --parallel -P1 1280 -P2 512 --raw_weight 0
Code is tested on 2 x 24gb Titan RTX with batch size 30 and parallelism implemented through PyTorch DataParallel. Ablation experiments run with similar configuration on 4 x 16gb Tesla v100.
Pretrained model can be found in 'checkpoints' directory.
Please cite our work if you find it useful:
@InProceedings{Alliegro_2021_CVPR,
author = {Alliegro, Antonio and Valsesia, Diego and Fracastoro, Giulia and Magli, Enrico and Tommasi, Tatiana},
title = {Denoise and Contrast for Category Agnostic Shape Completion},
booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year = {2021},
pages = {4629-4638}
}