# Single View Reconstruction
## Overview
<p align="center">
<img src="readme.gif" alt="data overview image" width=800>
</p>
#### Abstract
We present a novel approach to infer volumetric reconstructions from a single viewport, based only on a RGB image and a reconstructed normal image.
To overcome the problem of reconstructing regions in 3D that are occluded in the 2D image, we propose to learn this information from synthetically generated high-resolution data.
To do this, we introduce a deep network architecture that is specifically designed for volumetric TSDF data by featuring a specific tree net architecture.
Our framework can handle a 3D resolution of 512³ by introducing a dedicated compression technique based on a modified autoencoder.
Furthermore, we introduce a novel loss shaping technique for 3D data that guides the learning process towards regions where free and occupied space are close to each other.
As we show in experiments on synthetic and realistic benchmark data, this leads to very good reconstruction results, both visually and in terms of quantitative measures.
#### Content description
This repository contains everything necessary to reproduce the results presented in our paper.
This includes the generation of the data and the training of our model.
Be aware, that the generation of the data is time consuming as each process is optimized to the maximum but still billions of truncated signed distance values and weights have to be calculated.
Including of course all the color and normals images.
The data used for the training of our model was after compression around 1 TB big.
As SUNCG is not longer available, we can not upload the data, we used for training as it falls under the the SUNCG blocking.
If you do not have access to the SUNCG dataset, you can try using the [3D-Front](https://tianchi.aliyun.com/specials/promotion/alibaba-3d-scene-dataset) dataset and change the code to match this new dataset.
### Environment
Before you execute any of the modules in this project, please install the conda environment:
```shell script
conda env create -f environment.yml
```
This will create the `SingleViewReconstruction` environment, you can use it by:
```shell script
conda activate SingleViewReconstruction
```
This uses `Tensorflow 1.15` with `python 3.7`. This also includes some OpenGL packages for the visualizer.
### Quick and easy complete run of the pipeline
There is a script, which provides a full run of the BlenderProc pipeline, you will need the `"SingleViewReconstruction"` environment.
But, be aware before you executed this script. That it will execute a lot of code and download a lot of stuff to your PC.
This program will download `BlenderProc` and then afterwards `blender`. It will also download the `SceneNet` dataset and the corresponding texture lib used by `SceneNet`.
It will render some color & normal images for the pipeline and will also generate a true output voxelgrid to compare the results to best possible.
Before running, this make sure that you adapt the `SDFGen/CMakeLists.txt` file. See this [README.md](SDFGen/README.md).
```shell script
python run_on_example_scenes_from_scenenet.py
```
This will take a while and afterwards you can look at the generated scene with:
```shell script
python TSDFRenderer/visualize_tsdf.py BlenderProc/output_dir/output_0.hdf5
```
### Data generation
This is a quick overview over the data generation process, it is all based on the SUNCG house files.
<p align="center">
<img src="data_overview.png" alt="data overview image" width=500>
</p>
1. The SUNCG house.json file is converted with the SUNCGToolBox in a house.obj and camerapositions file, for more information: [SUNCG](SUNCG)
2. Then, these two files are used to generate the TSDF voxelgrids, for more information: [SDFGen](SDFGen)
3. The voxelgrid is used to calculate the loss weights via the [LossCalculatorTSDF](LossCalculatorTSDF)
4. They are used to first the train an autoencoder and then compress the 512³ voxelgrids down to a size of 32³x64, which we call encoded. See [CompressionAutoEncoder](CompressionAutoEncoder).
5. Now only the color & normal images are missing, for that we use [BlenderProc](https://github.com/DLR-RM/BlenderProc) with the config file defined in [here](BlenderProc).
These are then combined with this [script](SingleViewReconstruction/generate_tf_records.py) to several tf records, which are then used to [train](SingleViewReconstruction/train.py) our SingleViewReconstruction network.
### Download of the trained models
We provide a [script](download_models.py) to easily download all models trained in this approach:
1. The [SingleViewReconstruction](SingleViewReconstruction) model
2. The Autoencoder Compression Model [CompressionAutoEncoder](CompressionAutoEncoder)
3. The Normal Generation Model [UNetNormalGen](UNetNormalGen)
```shell script
python download_models.py
```
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
三维重建-基于RGB图像+法线图像预测体积重建算法-体积TSDF数据设计-优质项目实战.zip (111个子文件)
PolygonTest.cc 4KB
StopWatch.cc 692B
StopWatch.cc 692B
Line.cc 387B
Plane.cc 73B
Array3D.cc 66B
Space.cpp 22KB
main.cpp 10KB
Polygon.cpp 8KB
Octree.cpp 7KB
main.cpp 6KB
PolygonCubeIntersection.cpp 5KB
ObjReader.cpp 2KB
BoundingBox.cpp 393B
readme.gif 5.27MB
VertexShader.glsl 3KB
FragmentShader.glsl 721B
Array3D.h 12KB
Point.h 6KB
Transform_i.h 4KB
Point_i.h 3KB
Polygon.h 3KB
Space.h 3KB
Hdf5ReaderAndWriter.h 3KB
Hdf5Writer.h 2KB
Octree.h 2KB
Utility.h 2KB
Plane.h 1KB
Array3D.h 1KB
Transform.h 1KB
BoundingBox.h 1KB
PolygonCubeIntersection.h 1KB
AvgNumber.h 1KB
Array3D_i.h 999B
Image.h 961B
StopWatch.h 890B
StopWatch.h 890B
ObjReader.h 784B
MinMaxValue.h 778B
Line.h 330B
PolygonTest.h 240B
color_normal_mean.hdf5 10.49MB
config.json 2KB
README.md 5KB
README.md 2KB
README.md 2KB
README.md 2KB
README.md 2KB
README.md 2KB
README.md 1KB
README.md 1KB
README.md 527B
data_overview.png 226KB
autoencoder.py 23KB
dataset.py 21KB
TreeModel.py 18KB
RenderObject.py 15KB
run_on_example_scenes_from_scenenet.py 13KB
LossManager.py 10KB
calcMetrics.py 10KB
WindowManager.py 9KB
predict_datapoint.py 8KB
train.py 7KB
DataSetLoader.py 7KB
generate_tf_records.py 7KB
generate_tfrecords.py 6KB
mat4.py 6KB
SettingsReader.py 6KB
vec3.py 5KB
vec4.py 4KB
model.py 4KB
train.py 4KB
data_loader.py 4KB
decode.py 3KB
timedprinter.py 3KB
generate_predicted_normals.py 3KB
encode.py 3KB
generate_house_objs_and_cameras.py 3KB
visualize_tsdf.py 2KB
download_models.py 2KB
timeframe.py 2KB
configreader.py 2KB
common.py 2KB
generate_color_and_normal_imgs.py 2KB
convert_hdf5_to_sdf_format.py 2KB
loss_manager.py 1KB
generate_loss_values.py 1KB
generate_tsdf_volumes.py 1KB
train.py 1KB
averagestopwatch.py 1KB
stopwatch.py 1019B
estimatedtimer.py 996B
settings_reader.py 788B
stopwatchcontext.py 677B
averagenumber.py 637B
generate_encoded_outputs.py 553B
__init__.py 336B
__init__.py 147B
__init__.py 110B
__init__.py 0B
共 111 条
- 1
- 2
资源评论
JZSJ
- 粉丝: 2w+
- 资源: 1325
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功