|
2 | 2 |
|
3 | 3 | This is the source code for the paper `3D-R2N2: A Unified Approach for Single and Multi-view 3D Object Reconstruction, ECCV 2016`. Given one or multiple views of an object, the network generate voxelized (voxel is 3D equivalent of pixel) reconstruction of the object in 3D.
|
4 | 4 |
|
| 5 | +## Citing this work |
5 | 6 |
|
6 |
| -## Overview |
7 |
| - |
8 |
| -Given a set of images |
9 |
| - |
10 |
| -- [ShapeNet rendering](http://cvgl.stanford.edu/data2/ShapeNetRendering.tgz) |
11 |
| -- [ShapeNet voxelized models](http://cvgl.stanford.edu/data2/ShapeNetVox32.tgz) |
12 |
| - |
13 |
| -## Installation |
14 |
| - |
15 |
| -1. Download `ShapeNetCore` dataset |
16 |
| -2. Set the `MODEL_ROOT_PATH` in `lib/config.py` to the extracted `ShapeNetCore` |
17 |
| -3. Download model lists from the website. Some models do not have any faces. |
18 |
| -4. Generate dataset `json` file by running `python tools/gen_category_list.py` |
19 |
| -5. Voxelize all the models by running `python tools/voxelize_models.py` |
20 |
| -6. Render all the models by runnning `python tools/render_models.py`. To run this step, you have to setup `blender`. |
21 |
| -7. Set `cfg.DIR.MODEL_PATH`, `cfg.DIR.RENDERING_PATH` and `cfg.DIR.VOXEL_PATH` in `lib/config.py` accoringly |
22 |
| -8. Run experiments `bash ./experiments/script/mv_lstm_vec_net.sh` |
23 |
| - |
24 |
| -## Installation |
25 |
| - |
26 |
| -### CUDA Setup |
27 |
| - |
28 |
| -Follow the [instruction](http://deeplearning.net/software/theano/install.html) and set GPU + CUDA. |
29 |
| - |
30 |
| -1. `CUDA_ROOT=/path/to/cuda/root` |
31 |
| -2. add a cuda.root flag to THEANO_FLAGS, as in `THEANO_FLAGS='cuda.root=/path/to/cuda/root'` |
32 |
| -3. add a [cuda] section to your .theanorc file containing the option root = /path/to/cuda/root. |
33 |
| - |
34 |
| -Download `cuDNN3` and follow the [instruction](http://deeplearning.net/software/theano/library/sandbox/cuda/dnn.html) |
35 |
| - |
36 |
| -A non-intrusive installation is to set |
37 |
| - |
38 |
| -``` |
39 |
| -export LD_LIBRARY_PATH=/home/user/path_to_CUDNN_folder/lib64:$LD_LIBRARY_PATH |
40 |
| -export CPATH=/home/user/path_to_CUDNN_folder/include:$CPATH |
41 |
| -export LIBRARY_PATH=/home/user/path_to_CUDNN_folder/lib64:$LD_LIBRARY_PATH |
42 |
| -``` |
43 |
| - |
44 |
| -### Theano |
45 |
| - |
46 |
| -Install bleeding-edge Theano. |
| 7 | +If you find this work useful in your research, please consider citing: |
47 | 8 |
|
48 | 9 | ```
|
49 |
| -pip install --upgrade --no-deps git+git://github.com/Theano/Theano.git |
50 |
| -``` |
51 |
| - |
52 |
| -#### Theanorc Setup |
53 |
| - |
54 |
| -``` |
55 |
| -[global] |
56 |
| -floatX = float32 |
57 |
| -base_compiledir = /var/tmp |
58 |
| -
|
59 |
| -# Get an error message if cuDNN is not available |
60 |
| -optimizer_including = cudnn |
| 10 | +@article{choy20163d, |
| 11 | + title={3D-R2N2: A Unified Approach for Single and Multi-view 3D Object Reconstruction}, |
| 12 | + author={Choy, Christopher B and Xu, Danfei and Gwak, JunYoung and Chen, Kevin and Savarese, Silvio}, |
| 13 | + journal={arXiv preprint arXiv:1604.00449}, |
| 14 | + year={2016} |
| 15 | +} |
| 16 | +
|
| 17 | +@inproceedings{choy_eccv16, |
| 18 | + author={Choy, Christopher B and Xu, Danfei and Gwak, JunYoung and Chen, Kevin and Savarese, Silvio}, |
| 19 | + title={3D-R2N2: A Unified Approach for Single and Multi-view 3D Object Reconstruction}, |
| 20 | + booktitle={European Conference on Computer Vision (ECCV)}, |
| 21 | + year={2016} |
| 22 | +} |
61 | 23 | ```
|
62 | 24 |
|
63 |
| -#### Issues |
64 |
| - |
65 |
| -- Upgrading from cuDNNv2 |
66 |
| - |
67 |
| - If you encounter |
68 |
| - |
69 |
| - ``` |
70 |
| - ImportError: libcudnn.so.6.5: cannot open shared object file: No such file or directory |
71 |
| - ``` |
72 |
| -
|
73 |
| - Delete all binary files in the `base_compiledir` [link](http://deeplearning.net/software/theano/library/config.html#config.base_compiledir) |
74 |
| -
|
75 |
| -
|
76 |
| -### Blender |
77 |
| -
|
78 |
| -Go to the blender website and download the [latest blender](https://developer.blender.org/diffusion/B/) |
79 |
| -
|
80 |
| -``` |
81 |
| -# read-only access |
82 |
| -git clone git://git.blender.org/blender.git |
| 25 | +## Overview |
83 | 26 |
|
84 |
| -# read/write access |
85 |
| -git clone git@git.blender.org:blender.git |
| 27 | + |
| 28 | +*Left: images found on Ebay, Amazon, Right: overview of `3D-R2N2`* |
86 | 29 |
|
87 |
| -cd blender |
88 |
| -git submodule update --init --recursive |
89 |
| -git submodule foreach git checkout master |
90 |
| -git submodule foreach git pull --rebase origin master |
91 |
| -``` |
| 30 | +Traditionally, single view reconstruction and multi view reconstruction are disjoint problmes that has been dealt using different approaches. In this work, we first propose a unified framework for both single and multi view reconstruction using a `3D Recurrent Reconstruction Neural Network` (3D-R2N2). |
92 | 31 |
|
93 |
| -Then, follow the instruction on compiling the blender with the python module support [http://wiki.blender.org/index.php/User:Ideasman42/BlenderAsPyModule] |
| 32 | +| Schematics of `3D-Convolutional LSTM` | Inputs for each cell | |
| 33 | +|:-------------------------------------:|:-------------------------:| |
| 34 | +|  |  | |
94 | 35 |
|
95 |
| -Make sure to set the following flags correctly. |
| 36 | +We can feed images in a random order but the network is invariant to the order. The ciritical component that enables the network to be invariant to the order is the `3D-Convolutional LSTM` which we first proposed in this work. The `3D-Convolutional LSTM` selectively updates parts that are visible and keeps the parts that are self occluded (please refer to [http://cvgl.stanford.edu/3d-r2n2/](http://cvgl.stanford.edu/3d-r2n2/) for the supplementary material for analysis). |
96 | 37 |
|
97 |
| -``` |
98 |
| -WITH_PYTHON_INSTALL=OFF |
99 |
| -WITH_PLAYER=OFF |
100 |
| -WITH_PYTHON_MODULE=ON |
101 |
| -... |
102 |
| -WITH_OPENCOLLADA=ON |
103 |
| -``` |
| 38 | +## Datasets |
104 | 39 |
|
105 |
| -OpenCollada is optional if you wan to use collada (.dae) files. Install OpenCollada first. |
| 40 | +We used [ShapeNet](http://shapenet.cs.stanford.edu) models to generated rendered images and voxelized models which are available below (you can follow the installation instruction below to extract it on the default directory). |
106 | 41 |
|
| 42 | +- ShapeNet rendered images [ftp://cs.stanford.edu/cs/cvgl/ShapeNetRendering.tgz](ftp://cs.stanford.edu/cs/cvgl/ShapeNetRendering.tgz) |
| 43 | +- ShapeNet voxelized models [ftp://cs.stanford.edu/cs/cvgl/ShapeNetVox32.tgz](ftp://cs.stanford.edu/cs/cvgl/ShapeNetVox32.tgz) |
107 | 44 |
|
108 |
| -### OpenCollada |
| 45 | +## Installation |
109 | 46 |
|
110 |
| -This will requires gcc4.7 |
| 47 | +The package requires python3. You can follow the direction below to install virtual environment within the repository or install anaconda for python 3. |
| 48 | + |
| 49 | +- Download the repository |
| 50 | + ``` |
| 51 | + git clone https://github.com/chrischoy/3D-R2N2.git |
| 52 | + ``` |
| 53 | +- Setup virtual environment and install requirements |
| 54 | + ``` |
| 55 | + cd 3D-R2N2 |
| 56 | + pip install virtualenv |
| 57 | + virtualenv -p python3 py3 |
| 58 | + source py3/bin/activate |
| 59 | + pip install -r requirements.txt |
| 60 | + ``` |
| 61 | +- Download trained network weight |
| 62 | + ``` |
| 63 | + wget asdfasdf |
| 64 | + ``` |
| 65 | +- run the demo code |
| 66 | + ``` |
| 67 | + python demo.py |
| 68 | + ``` |
| 69 | + |
| 70 | +### Training the network |
| 71 | + |
| 72 | +- Download datasets and place them in a folder named `ShapeNet` |
| 73 | + ``` |
| 74 | + mkdir ShapeNet/ |
| 75 | + wget ftp://cs.stanford.edu/cs/cvgl/ShapeNetRendering.tgz |
| 76 | + wget ftp://cs.stanford.edu/cs/cvgl/ShapeNetVox32.tgz |
| 77 | + tar -xzf ShapeNetRendering.tgz -C ShapeNet/ |
| 78 | + tar -xzf ShapeNetVox32.tgz -C ShapeNet/ |
| 79 | + ``` |
| 80 | +- Run experiments `bash ./experiments/script/mv_lstm_vec_net.sh` |
| 81 | + |
| 82 | +### Miscellaneous setup |
| 83 | + |
| 84 | +#### CUDA Setup |
111 | 85 |
|
112 |
| -``` |
113 |
| -git clone https://github.com/KhronosGroup/OpenCOLLADA |
114 |
| -mkdir OpenCOLLADA-build |
115 |
| -cd OpenCOLLADA-build |
116 |
| -cmake ../OpenCOLLADA -DUSE_SHARED=ON |
117 |
| -make |
118 |
| -make install |
119 |
| -``` |
| 86 | +Follow the [instruction](http://deeplearning.net/software/theano/install.html) and set GPU + CUDA. |
120 | 87 |
|
121 |
| -## Python 3 Requirements |
| 88 | +#### Theano |
122 | 89 |
|
123 |
| -On the root path, run |
| 90 | +Install bleeding-edge Theano using |
124 | 91 |
|
125 | 92 | ```
|
126 |
| -pip3 install -r requirements.txt |
| 93 | +pip install --upgrade --no-deps git+git://github.com/Theano/Theano.git |
127 | 94 | ```
|
128 |
| -
|
129 |
| -
|
130 |
| -# Dataset Setting |
131 |
| -
|
132 |
| -- Download ShapeNet |
133 |
| -- Set variables in lib/config.py |
134 |
| -- Generate training dataset lists |
135 |
| - ``` |
136 |
| - python tools/generate_category_list.py |
137 |
| - ``` |
138 |
| -- Generate rendering and voxelization |
139 |
| -- Run the training script |
140 |
| -
|
141 |
| -
|
142 |
| -# Erroneous Files |
143 |
| -
|
144 |
| -03624134/67ada28ebc79cc75a056f196c127ed77/model.obj |
145 |
| -04090263/4a32519f44dc84aabafe26e2eb69ebf4/model.obj |
146 |
| -04074963/b65b590a565fa2547e1c85c5c15da7fb/model.obj |
147 |
| -
|
0 commit comments