prajwalsingh / 3DAttriFlow

Implementation of CVPR'2022: 3D Shape Reconstruction from 2D Images with Disentangled Attribute Flow

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

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.

  • Install python Dependencies
cd 3D-AttriFlow
conda create -n "i3d" python=3.9 anaconda
conda activate i3d
conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch
pip install -r requirements.txt
  • Compile PyTorch 3rd-party modules.
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
  • You need to update the file path of the datasets in cfgs/SVR.yaml line 63:
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:

  • To train a model:
python train_svr.py -c cfgs/SVR.yaml -gpu 0
or
python train_pc.py -c cfgs/PC.yaml -gpu 0
  • To test a model:
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.

About

Implementation of CVPR'2022: 3D Shape Reconstruction from 2D Images with Disentangled Attribute Flow

License:MIT License


Languages

Language:Python 83.0%Language:Cuda 12.8%Language:C++ 3.5%Language:C 0.6%Language:Shell 0.1%