Home

Awesome

HorizonNet

This is the implementation of our CVPR'19 " HorizonNet: Learning Room Layout with 1D Representation and Pano Stretch Data Augmentation" (project page).

Update

Feature

This repo is a pure python implementation that you can:

Method overview

Installation

Pytorch installation is machine dependent, please install the correct version for your machine. The tested version is pytorch 1.8.1 with python 3.7.6.

<details> <summary> Dependencies (click to expand) </summary> </details>

Download

Dataset

Pretrained Models

Plase download the pre-trained model here

Inference on your images

In below explaination, I will use assets/demo.png for example.

1. Pre-processing (Align camera rotation pose)

2. Estimating layout with HorizonNet

3. Layout 3D Viewer

Your own dataset

See tutorial on how to prepare it.

Training

To train on a dataset, see python train.py -h for detailed options explaination.
Example:

python train.py --id resnet50_rnn

Quantitative Evaluation - Cuboid Layout

To evaluate on PanoContext/Stanford2d3d dataset, first running the cuboid trained model for all testing images:

python inference.py --pth ckpt/resnet50_rnn__panos2d3d.pth --img_glob "data/layoutnet_dataset/test/img/*" --output_dir output/panos2d3d/resnet50_rnn/ --force_cuboid

To get the quantitative result:

python eval_cuboid.py --dt_glob "output/panos2d3d/resnet50_rnn/*json" --gt_glob "data/layoutnet_dataset/test/label_cor/*txt"

If you want to:

:clipboard: The quantitative result for the released resnet50_rnn__panos2d3d.pth is shown below:

Testing Dataset3D IoU(%)Corner error(%)Pixel error(%)
PanoContext83.390.762.13
Stanford2D3D84.090.632.06
All83.870.672.08

Quantitative Evaluation - General Layout

TODO

Acknowledgement

Citation

@inproceedings{SunHSC19,
  author    = {Cheng Sun and
               Chi{-}Wei Hsiao and
               Min Sun and
               Hwann{-}Tzong Chen},
  title     = {HorizonNet: Learning Room Layout With 1D Representation and Pano Stretch
               Data Augmentation},
  booktitle = {{IEEE} Conference on Computer Vision and Pattern Recognition, {CVPR}
               2019, Long Beach, CA, USA, June 16-20, 2019},
  pages     = {1047--1056},
  year      = {2019},
}