├── requirements.txt └── README.md /requirements.txt: -------------------------------------------------------------------------------- 1 | argparse 2 | easydict 3 | matplotlib 4 | numpy 5 | opencv-python 6 | pyexr 7 | scipy 8 | torch>=1.4.0 9 | torchvision 10 | tensorboardX 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Stereo 3D Reconstruction 2 | 3 | This repository contains the source code for the paper [Toward 3D Object Reconstruction from Stereo Images](https://arxiv.org/abs/1910.08223.pdf). 4 | 5 | **Important Note:** The source code is in the ([Stereo2Voxel](https://github.com/hzxie/Stereo-3D-Reconstruction/tree/Stereo2Voxel)/[Stereo2Point](https://github.com/hzxie/Stereo-3D-Reconstruction/tree/Stereo2Point)) branches of the repository. 6 | 7 | ![Overview](https://www.infinitescript.com/projects/Stereo-3D-Reconstruction/Stereo-3D-Reconstruction-Overview.jpg) 8 | 9 | ## Cite this work 10 | 11 | ``` 12 | @article{xie2021towards, 13 | title={Toward 3D Object Reconstruction from Stereo Images}, 14 | author={Xie, Haozhe and 15 | Tong, Xiaojun and 16 | Yao, Hongxun and 17 | Zhou, Shangchen and 18 | Zhang, Shengping and 19 | Sun, Wenxiu}, 20 | journal={Neurocomputing}, 21 | year={2021} 22 | } 23 | ``` 24 | 25 | ## Datasets 26 | 27 | We use the [StereoShapeNet](https://www.shapenet.org/) dataset in our experiments, which is available below: 28 | 29 | - [StereoShapeNet](https://gateway.infinitescript.com/?fileName=StereoShapeNet) 30 | 31 | ## Pretrained Models 32 | 33 | The pretrained models on StereoShapeNet are available as follows: 34 | 35 | - [Stereo2Voxel for StereoShapeNet](https://gateway.infinitescript.com/?fileName=Stereo2Voxel-StereoShapeNet.pth) (309 MB) 36 | - [Stereo2Point for StereoShapeNet](https://gateway.infinitescript.com/?fileName=Stereo2Point-StereoShapeNet.pth) (356 MB) 37 | 38 | ## Prerequisites 39 | 40 | #### Clone the Code Repository 41 | 42 | ``` 43 | git clone https://github.com/hzxie/Stereo-3D-Reconstruction.git 44 | ``` 45 | 46 | #### Install Python Denpendencies 47 | 48 | ``` 49 | cd Stereo-3D-Reconstruction 50 | pip install -r requirements.txt 51 | ``` 52 | 53 | #### Train/Test Stereo2Voxel 54 | 55 | ``` 56 | git checkout Stereo2Voxel 57 | ``` 58 | 59 | #### Train/Test Stereo2Point 60 | 61 | ``` 62 | git checkout Stereo2Point 63 | 64 | cd extensions/chamfer_dist 65 | python setup.py install --user 66 | ``` 67 | 68 | #### Update Settings in `config.py` 69 | 70 | You need to update the file path of the datasets: 71 | 72 | ``` 73 | __C.DATASETS.SHAPENET.LEFT_RENDERING_PATH = '/path/to/ShapeNetStereoRendering/%s/%s/render_%02d_l.png' 74 | __C.DATASETS.SHAPENET.RIGHT_RENDERING_PATH = '/path/to/ShapeNetStereoRendering/%s/%s/render_%02d_r.png' 75 | __C.DATASETS.SHAPENET.LEFT_DISP_PATH = '/path/to/ShapeNetStereoRendering/%s/%s/disp_%02d_l.exr' 76 | __C.DATASETS.SHAPENET.RIGHT_DISP_PATH = '/path/to/ShapeNetStereoRendering/%s/%s/disp_%02d_r.exr' 77 | __C.DATASETS.SHAPENET.VOLUME_PATH = '/path/to/ShapeNetVox32/%s/%s.mat' 78 | ``` 79 | 80 | ## Get Started 81 | 82 | To train GRNet, you can simply use the following command: 83 | 84 | ``` 85 | python3 runner.py 86 | ``` 87 | 88 | To test GRNet, you can use the following command: 89 | 90 | ``` 91 | python3 runner.py --test --weights=/path/to/pretrained/model.pth 92 | ``` 93 | 94 | ## License 95 | 96 | This project is open sourced under MIT license. 97 | --------------------------------------------------------------------------------