Skip to content

[CVPR'2022]: 3D Shape Reconstruction from 2D Images with Disentangled Attribute Flow

License

Notifications You must be signed in to change notification settings

junshengzhou/3DAttriFlow

Repository files navigation

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
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

[CVPR'2022]: 3D Shape Reconstruction from 2D Images with Disentangled Attribute Flow

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published