Home

Awesome

3D Shape Reconstruction from 2D Images with Disentangled Attribute Flow (CVPR22)

This repository contains the code for the paper. 3D Shape Reconstruction from 2D Images with Disentangled Attribute Flow.

<p align="center", width="780" > <img src="img/overview.png"/> </p>

If you find our code or paper useful, please consider citing

@inproceedings{3DAttriFlow,
    title = {3D Shape Reconstruction from 2D Images with Disentangled Attribute Flow},
    author = {Wen, Xin and Zhou, Junsheng and Liu, Yu-Shen and Su, Hua and Dong, Zhen and Han, Zhizhong},
    booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
    year = {2022}
}

Installation:

Our code is implemented in Python 3.5, PyTorch 1.2 and CUDA 10.0.

cd 3D-AttriFlow
pip install -r requirements.txt
cd utils/ChamferDistancePytorch/chamfer3D
python setup.py install
cd -
cd utils/Pointnet2.PyTorch/pointnet2
python setup.py install
cd -
cd utils/emd
python setup.py install
cd -

Dataset:

Single View Reconstruction

mkdir cache
mkdir cache_test
pointcloud_path: 'Path/ShapeNetV1PointCloud'
image_path: 'Path/ShapeNetV1Renderings'
cache_path: 'Path/cache'
cache_path: 'Path/cache_test'

Point Cloud Completion

if prefix=="train":
    self.file_path = 'Path/MVP_Train_CP.h5'
elif prefix=="val":
    self.file_path = 'Path/MVP_Test_CP.h5'

Checkpoints:

Usage:

python train_svr.py -c cfgs/SVR.yaml -gpu 0
or
python train_pc.py -c cfgs/PC.yaml -gpu 0
python val_svr.py -c cfgs/SVR.yaml -gpu 0
or 
python val_pc.py -c cfgs/PC.yaml -gpu 0

Acknowledgements

Some of the code of this repo is borrowed from VRCNet, EigenGAN-Pytorch, pytorchpointnet++ and ChamferDistancePytorch. We thank the authors for their great job!

License

This project is open sourced under MIT license.