# IRS
IRS: A Large Naturalistic Indoor Robotics Stereo Dataset to Train Deep Models for Disparity and Surface Normal Estimation
# Introduction
**IRS** is an open dataset for indoor robotics vision tasks, especially disparity and surface normal estimation. It contains totally 103,316 samples covering a wide range of indoor scenes, such as home, office, store and restaurant.
|
|
|
|:--:|:--:|
|Left image|Right image|
|
|
|
|Disparity map|Surface normal map|
*****
# Overview of IRS
Rendering Characteristic|Options
:--|:--:
indoor scene class|home(31145), office(43417), restaurant(22058), store(6696)
object class|desk, chair, sofa, glass, mirror, bed, bedside table, lamp, wardrobe, etc.
brightness|over-exposure(>1300), darkness(>1700)
light behavior|bloom(>1700), lens flare(>1700), glass transmission(>3600), mirror reflection(>3600)
We give some sample of different indoor scene characteristics as follows. The parameters of the virtual stereo camera in UE4 are as follows:
- Baseline: 0.1 meter
- Focal Length: 480 for both the x-axis and y-axis.
|
|
|
|
|:--:|:--:|:--:|
|Home|Office|Restaurant|
|
|
|
|
|Normal light|Over exposure|Darkness|
|
|
|
|
|Glass|Mirror|Metal|
# Network Structure of DTN-Net
We designed a novel deep model, DTN-Net, to predict the surface normal map by refining the initial one transformed from the predicted disparity. DTN-Net (**D**isparity **T**o **N**ormal Network) is comprised of two modules, **[RD-Net](https://arxiv.org/pdf/1512.02134.pdf)** and NormNetS. First, RD-Net predicts the disparity map for the input stereo images. Then we apply the transformation from disparity to normal in **[GeoNet](https://arxiv.org/abs/2012.06980)**, denoted by D2N Transform, to produces the initial coarse normal map. Finally, NormNetS takes the stereo images, the predicted disparity map by RD-Net and the initial normal map as input and predicts the final normal map. The structure of NormNetS is similar to **[DispNetS](https://arxiv.org/pdf/1512.02134.pdf)** except that the final convolution layer outputs three channels instead of one, as each pixel normal has three dimension (x,y,z).
# Paper
Q. Wang\*,1, S. Zheng\*,1, Q. Yan\*,2, F. Deng2, K. Zhao†,1, X. Chu†,1.
IRS: A Large Naturalistic Indoor Robotics Stereo Dataset to Train Deep Models for Disparity and Surface Normal Estimation. [\[preprint\]](https://arxiv.org/abs/1912.09678)
* indicates equal contribution. † indicates corresponding authors.
1Department of Computer Science, Hong Kong Baptist University. 2School of Geodesy and Geomatics, Wuhan University.
# Download
You can use the following OneDrive link to download our dataset.
OneDrive: https://1drv.ms/f/s!AmN7U9URpGVGem0coY8PJMHYg0g?e=nvH5oB
# Video Demonstration
[](http://www.youtube.com/watch?v=jThNQFHNU_s)
# Usage
### Dependencies
- [Python 3.7](https://www.python.org/downloads/)
- [PyTorch 1.6.0+](http://pytorch.org)
- torchvision 0.5.0+
- CUDA 10.1 (https://developer.nvidia.com/cuda-downloads)
### Install
We recommend using [conda](https://www.anaconda.com/distribution/) for installation:
```shell
conda env create -f environment.yml
```
Install dependencies:
```
cd layers_package
./install.sh
# install OpenEXR (https://www.openexr.com/)
sudo apt-get update
sudo apt-get install openexr
```
### Dataset
Download IRS dataset from https://1drv.ms/f/s!AmN7U9URpGVGem0coY8PJMHYg0g?e=nvH5oB (OneDrive). \
Extract zip files and put them in correct folder:
```
data
└── IRSDataset
├── Home
├── Office
├── Restaurant
└── Store
```
### Pretrained Model
"FT3D" denotes FlyingThings3D.
| | IRS | FT3D | IRS+FT3D |
|---|---|---|---|
|FADNet|[fadnet-ft3d.pth](https://drive.google.com/file/d/1XH0l9wS-CDfVCQJDE1CZOx-g0qgb4VmE/view?usp=sharing)|[fadnet-irs.pth](https://drive.google.com/file/d/13mKnv4Z19jpxu_t3gWstrPAx3Cqaxq04/view?usp=sharing)|[fadnet-ft3d-irs.pth](https://drive.google.com/file/d/1EPkCeedWFo0xqL4W1Zoe9VTde4zv8bKT/view?usp=sharing)|
|GwcNet|[gwcnet-ft3d.pth](https://drive.google.com/file/d/1Ptk92srE_WicztONIm1m0vm6edsgllac/view?usp=sharing)|[gwcnet-irs.pth](https://drive.google.com/file/d/1Y7RVxWOGOHqAY7J2y52RzvukIySETgzs/view?usp=sharing)|[gwcnet-ft3d-irs.pth](https://drive.google.com/file/d/1YTsDlyFr8FjqCjBE8AJkt2UaTWgBbUG1/view?usp=sharing)|
| | DTN-Net | DNF-Net | NormNetS |
|---|---|---|---|
|IRS|[dtonnet-irs.pth](https://drive.google.com/file/d/1jdg35tPK7Ii2bYL-q1WIDpFhJY8l2RJK/view?usp=sharing)|[dnfusionnet-irs.pth](https://drive.google.com/file/d/1xnT-0aaVLKjb4engBiZXPRFui3GEH_GN/view?usp=sharing)|[normnets-irs.pth](https://drive.google.com/file/d/1PZub6sQKeHH9HP9JjzQ_fmJXZ6y_u2Lu/view?usp=sharing)|
### Train
There are configurations for train in "exp_configs" folder. You can create your own configuration file as samples. \
As an example, following configuration can be used to train a DispNormNet on IRS dataset: \
\
/exp_configs/dtonnet.conf
```
net=dispnormnet
loss=loss_configs/dispnetcres_irs.json
outf_model=models/${net}-irs
logf=logs/${net}-irs.log
lr=1e-4
devices=0,1,2,3
dataset=irs #sceneflow, irs, sintel
trainlist=lists/IRSDataset_TRAIN.list
vallist=lists/IRSDataset_TEST.list
startR=0
startE=0
endE=10
batchSize=16
maxdisp=-1
model=none
```
Then, the configuration should be specified in the "train.sh"\
\
/train.sh
```
dnn="${dnn:-dispnormnet}"
source exp_configs/$dnn.conf
python main.py --cuda --net $net --loss $loss --lr $lr \
--outf $outf_model --logFile $logf \
--devices $devices --batch_size $batchSize \
--dataset $dataset --trainlist $trainlist --vallist $vallist \
--startRound $startR --startEpoch $startE --endEpoch $endE \
--model $model \
--maxdisp $maxdisp \
--manualSeed 1024 \
```
Lastly, use the following command to start a train
```
./train.sh
```
### Evaluation
There is a script for evaluation with a model from a train \
\
/detech.sh
```
dataset=irs
net=dispnormnet
model=models/dispnormnet-irs/model_best.pth
outf=detect_results/${net}-${dataset}/
filelist=lists/IRSDataset_TEST.list
filepath=data
CUDA_VISIBLE_DEVICES=0 python detecter.py --model $model --rp $outf --filelist $filelist --filepath $filepath --devices 0 --net ${net} --disp-on --norm-on
```
Use the script in your configuration, and then get result in detect_result folder.\
\
Disparity results are saved in png format as default. \
Normal results are saved in exr format as default. \
\
If you want to change the output format, you need to modify "detecter.py" and use save function as follow
```
# png
skimage.io.imsave(filepath, image)
# pfm
save_pfm(filepath, data)
# exr
save_exr(data, filepath)
```
### EXR Viewer
For viewing files in exr format, we recommand a free software
- [RenderDoc](https://renderdoc.org/)
# Contact
Please contact us at [qiangwang@comp.hkbu.edu.hk](mailto:qiangwang@comp.hkbu.edu.hk) if you have any question.