All Projects → art-programmer → Floorplantransformation

art-programmer / Floorplantransformation

Licence: mit
Raster-to-Vector: Revisiting Floorplan Transformation

Programming Languages

lua
6591 projects

Projects that are alternatives of or similar to Floorplantransformation

Semantic3dnet
Point cloud semantic segmentation via Deep 3D Convolutional Neural Network
Stars: ✭ 170 (-30.04%)
Mutual labels:  torch
Torchinfo
View model summaries in PyTorch!
Stars: ✭ 203 (-16.46%)
Mutual labels:  torch
Visdial
[CVPR 2017] Torch code for Visual Dialog
Stars: ✭ 215 (-11.52%)
Mutual labels:  torch
Snapshotensemble
Snapshot Ensembles in Torch (Snapshot Ensembles: Train 1, Get M for Free)
Stars: ✭ 173 (-28.81%)
Mutual labels:  torch
Php Opencv
php wrapper for opencv
Stars: ✭ 194 (-20.16%)
Mutual labels:  torch
Netron
Visualizer for neural network, deep learning, and machine learning models
Stars: ✭ 17,193 (+6975.31%)
Mutual labels:  torch
Skip Thoughts.torch
Porting of Skip-Thoughts pretrained models from Theano to PyTorch & Torch7
Stars: ✭ 146 (-39.92%)
Mutual labels:  torch
Alphaction
Spatio-Temporal Action Localization System
Stars: ✭ 221 (-9.05%)
Mutual labels:  torch
Python Torchfile
Deserialize Lua torch-serialized objects from Python
Stars: ✭ 196 (-19.34%)
Mutual labels:  torch
Torch
R Interface to Torch
Stars: ✭ 214 (-11.93%)
Mutual labels:  torch
Npmt
Towards Neural Phrase-based Machine Translation
Stars: ✭ 175 (-27.98%)
Mutual labels:  torch
Online Neural Doodle
Feedforward neural doodle
Stars: ✭ 183 (-24.69%)
Mutual labels:  torch
Orn
Oriented Response Networks, in CVPR 2017
Stars: ✭ 207 (-14.81%)
Mutual labels:  torch
Torch Dct
DCT (discrete cosine transform) functions for pytorch
Stars: ✭ 173 (-28.81%)
Mutual labels:  torch
Torchdata
PyTorch dataset extended with map, cache etc. (tensorflow.data like)
Stars: ✭ 226 (-7%)
Mutual labels:  torch
Dockerfiles
Deep Learning Dockerfiles
Stars: ✭ 150 (-38.27%)
Mutual labels:  torch
Pytorch Beam Search Decoding
PyTorch implementation of beam search decoding for seq2seq models
Stars: ✭ 204 (-16.05%)
Mutual labels:  torch
Gpt2 Newstitle
Chinese NewsTitle Generation Project by GPT2.带有超级详细注释的中文GPT2新闻标题生成项目。
Stars: ✭ 235 (-3.29%)
Mutual labels:  torch
Echotorch
A Python toolkit for Reservoir Computing and Echo State Network experimentation based on pyTorch. EchoTorch is the only Python module available to easily create Deep Reservoir Computing models.
Stars: ✭ 231 (-4.94%)
Mutual labels:  torch
Opennmt
Open Source Neural Machine Translation in Torch (deprecated)
Stars: ✭ 2,339 (+862.55%)
Mutual labels:  torch

Raster-to-Vector: Revisiting Floorplan Transformation

By Chen Liu, Jiajun Wu, Pushmeet Kohli, and Yasutaka Furukawa

Introduction

This paper addresses the problem of converting a rasterized floorplan image into a vector-graphics representation. Our algorithm significantly outperforms existing methods and achieves around 90% precision and recall, getting to the range of production-ready performance. To learn more, please refer to our ICCV 2017 paper or visit our project website.

This code implements the algorithm described in our paper in Torch7.

Updates

[12/21/2018] A PyTorch version is now available under folder pytorch/. It is much easier to compile and try. Please see the README file under the folder for details. Note that we haven't evaluated the performance of it yet. We also provide a free IP solver (not relying on Gurobi) at pytorch/IP.py.

[7/1/2018] For annotator codes, please see here.

[4/15/2018] We have a follow-up project which reconstructs floorplans from 3D scans. You can find it here.

Requirements

  • Please install the latest Torch.
  • Please install Python 2.7.
  • We used a Nvidia Titan GPU with CUDA 8.0 installed.

Torch packages

Python packages

Trained models

To use our trained model, please first download it from Google Drive, and put it under folder "checkpoint/" (or specify the its path via option -loadModel="path to the downloaded model").

Our model is fine-tuned based on the pose estimation network introduced in the paper, "Human pose estimation via Convolutional Part Heatmap Regression". You can downloaded their model here (the MPII one), and put it under folder "PoseEstimation/" (or specify the its path via option -loadPoseEstimationModel)

Data

We don't have the permission to share the rasterized images, which are from the LIFULL dataset. Here we only share our vector-graphics annotations which might be helpful for other tasks.

Our vector-graphics annotation is under "data/floorplan_representation" folder.

Each row in vector graphics annotations contains (x_min, y_min, x_max, y_max, category, dump_1, dump_2). Category can be either a wall, a door (opening in the paper), a specific icon type, or a specific room type. For walls and doors, two points, (x_min, y_min) and (x_max, y_max), form a line. For icons, x_min, y_min, x_max, and y_max specify a rectangle. For rooms, however, x_min, y_min, x_max, and y_max are unfortunately not for the bounding box of the room, as a room can be of arbitrary shape instead of a rectangle. So, x_min, y_min, x_max, and y_max just denote an arbitrary region which falls inside the room. Please refer to the data loader code to see how to process such annotations.

Here is the link to 100,000+ vector-graphics representation generated by our algorithm. You might want to get 3D popup models from the text files using the popup code below or draw 2D rendering images using the function fp_ut.drawRepresentationImage(floorplan, representation) (please see predict.lua for an example). Note that, since we cannot share the image data, you might need to change the code for either generating 3D popup models or rendering the 2D images.

Annotator

The code for the annotator is available under folder annotator/. You can find a similar annotator written using Python here.

Usage

To train the network from the pretrained pose estimation network, simply run

th main.lua -loadPoseEstimationModel  "path to the downloaded pose estimation model"

To load our trained model and resume training, please run

th main.lua -loadModel  "path to the downloaded pretrained model"

Here are som useful options for the main script:

  • -batchSize specifies the batch size
  • -LR specifies the learning rate
  • -nEpochs specifies the number of epochs
  • -checkpointEpochInterval specifies the number of training epochs between two checkpoints (useful if you want to save less number of checkpoints instead of saving one checkpoint for every epoch)
  • useCheckpoint specifies how the training resumes
    • -1: starting from the beginning even when checkpoints previously trained are found
    • 0 (default) resuming from checkpoints if found
    • n (n > 0) resuming from the nth checkpoint

To make prediction on a floorplan image, run

th predict.lua -loadModel "model path" -floorplanFilename "path to the floorplan image" -outputFilename "output filename"

Note that the above script will produce the vectorization result (saved in ".txt" file), the rendering image (saved in ".png" file), and a text file which could be used for generating 3D models (saved in "_popup.txt").

To evaluate performance on the benchmark, run

th evaluate.lua -loadModel "model path" -resultPath "path to save results"

Generate 3D models

Automatic 3D model generation based on our vectorization results is implemented in both C++ (under folder popup/) and Python (under folder rendering/).

For the C++ code, run the following:

cd popup/code/
cmake .
make
./popup_cli ../data/floorplan_1.txt

The data file (e.g., popup/data/floorplan_1.txt), which could be generated by predict.lua (*_popup.txt), has the following format:

width height
the number of walls
(Wall descriptions)
x_1, y_1, x_2, y_2, room type on the left, room type on the right
...
(Opening descriptions)
x_1, y_1, x_2, y_2, 'door', dummy, dummy
(Icon descriptions)
x_1, y_1, x_2, y_2, icon type, dummy, dummy

You could optionally use the corresponding input raster image or the final vector-graphics rendering as the texture image for the floor. To do so, please put the image under the data folder and rename it to the same name with the data file with suffix ".png" (e.g., floorplan_1.png).

The Python code is based on Panda3D. First enter folder rendering/, and then either run:

python viewer.py

to view a 3D model, or run:

python rendering.py

to render one view of the 3D model given camera pose. Please check the code to see how to specify the model to view and how to render different views.

Contact

If you have any questions, please contact me at [email protected].

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].