{"id":33174726,"url":"https://github.com/art-programmer/FloorplanTransformation","last_synced_at":"2025-11-20T20:01:44.050Z","repository":{"id":27075506,"uuid":"99371293","full_name":"art-programmer/FloorplanTransformation","owner":"art-programmer","description":"Raster-to-Vector: Revisiting Floorplan Transformation","archived":false,"fork":false,"pushed_at":"2022-06-21T21:36:10.000Z","size":10725,"stargazers_count":458,"open_issues_count":30,"forks_count":161,"subscribers_count":29,"default_branch":"master","last_synced_at":"2024-04-30T20:33:47.843Z","etag":null,"topics":["floorplan","pytorch","torch"],"latest_commit_sha":null,"homepage":"http://art-programmer.github.io/floorplan-transformation.html","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/art-programmer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-04T18:49:41.000Z","updated_at":"2024-04-29T14:05:09.000Z","dependencies_parsed_at":"2022-07-27T09:22:05.790Z","dependency_job_id":null,"html_url":"https://github.com/art-programmer/FloorplanTransformation","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/art-programmer/FloorplanTransformation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/art-programmer%2FFloorplanTransformation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/art-programmer%2FFloorplanTransformation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/art-programmer%2FFloorplanTransformation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/art-programmer%2FFloorplanTransformation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/art-programmer","download_url":"https://codeload.github.com/art-programmer/FloorplanTransformation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/art-programmer%2FFloorplanTransformation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":285503668,"owners_count":27182913,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-20T02:00:05.334Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["floorplan","pytorch","torch"],"created_at":"2025-11-16T02:00:33.687Z","updated_at":"2025-11-20T20:01:44.022Z","avatar_url":"https://github.com/art-programmer.png","language":"Lua","readme":"# Raster-to-Vector: Revisiting Floorplan Transformation\nBy Chen Liu, Jiajun Wu, Pushmeet Kohli, and Yasutaka Furukawa\n\n## Introduction\n\nThis paper addresses the problem of converting a rasterized\nfloorplan image into a vector-graphics representation.\nOur algorithm significantly outperforms\nexisting methods and achieves around 90% precision and\nrecall, getting to the range of production-ready performance. \nTo learn more, please refer to our ICCV 2017 [paper](http://art-programmer.github.io/floorplan-transformation/paper.pdf) or visit our [project website](http://art-programmer.github.io/floorplan-transformation.html).\n\nThis code implements the algorithm described in our paper in Torch7.\n\n## Updates\n[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*.\n\n[7/1/2018] For annotator codes, please see [here](#annotator).\n\n[4/15/2018] We have a follow-up project which reconstructs floorplans from 3D scans. You can find it [here](https://github.com/art-programmer/FloorNet).\n\n## Requirements\n\n- Please install the latest Torch.\n- Please install Python 2.7.\n- We used a Nvidia Titan GPU with CUDA 8.0 installed.\n\n### Torch packages\n- [nn](https://github.com/torch/nn)\n- [cunn](https://github.com/torch/cunn)\n- [cudnn](https://github.com/soumith/cudnn.torch)\n- [image](https://github.com/torch/image)\n- [ffi](http://luajit.org/ext_ffi.html)\n- [csvigo](https://github.com/clementfarabet/lua---csv)\n- [penlight](https://github.com/stevedonovan/Penlight)\n- [opencv](https://github.com/marcoscoffier/lua---opencv) (Probably need to be compiled from source)\n- [lunatic-python](https://labix.org/lunatic-python)\n\n### Python packages\n- [numpy](http://www.scipy.org/scipylib/download.html)\n- [Gurobi](http://www.gurobi.com)\n- [OpenCV](https://opencv.org/) (v3.4.1)\n\n## Trained models\nTo use our trained model, please first download it from [Google Drive](https://drive.google.com/file/d/0B2rs82y7tjKrQk0yRFB3RHVDUXM/view?usp=sharing), and put it under folder \"checkpoint/\" (or specify the its path via option -loadModel=\"path to the downloaded model\").\n\nOur 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](https://www.adrianbulat.com/human-pose-estimation) (the MPII one), and put it under folder \"PoseEstimation/\" (or specify the its path via option -loadPoseEstimationModel)\n\n## Data\nWe 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.\n\nOur vector-graphics annotation is under \"data/floorplan_representation\" folder.\n\nEach 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.\n\nHere is the [link](https://drive.google.com/file/d/1Ltn5kzzwhvXz6EStI98Zagfq-mI2pf0m/view?usp=sharing) 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.\n\n\n## Annotator\nThe code for the annotator is available under folder *annotator/*. You can find a similar annotator written using Python [here](https://github.com/art-programmer/FloorplanAnnotator).\n\n## Usage\nTo train the network from the pretrained pose estimation network, simply run\n```bash\nth main.lua -loadPoseEstimationModel  \"path to the downloaded pose estimation model\"\n```\n\nTo load our trained model and resume training, please run\n```bash\nth main.lua -loadModel  \"path to the downloaded pretrained model\"\n```\n\nHere are som useful options for the main script:\n- -batchSize  specifies the batch size\n- -LR specifies the learning rate\n- -nEpochs  specifies the number of epochs\n- -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)\n- useCheckpoint specifies how the training resumes\n  * -1: starting from the beginning even when checkpoints previously trained are found\n  * 0 (default) resuming from checkpoints if found\n  * n (n \u003e 0) resuming from the nth checkpoint\n\nTo make prediction on a floorplan image, run\n```bash\nth predict.lua -loadModel \"model path\" -floorplanFilename \"path to the floorplan image\" -outputFilename \"output filename\"\n```\nNote 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\").\n\nTo evaluate performance on the benchmark, run\n```bash\nth evaluate.lua -loadModel \"model path\" -resultPath \"path to save results\"\n```\n\n## Generate 3D models\nAutomatic 3D model generation based on our vectorization results is implemented in both C++ (under folder popup/) and Python (under folder rendering/).\n\nFor the C++ code, run the following:\n```bash\ncd popup/code/\ncmake .\nmake\n./popup_cli ../data/floorplan_1.txt\n```\n\nThe data file (e.g., popup/data/floorplan_1.txt), which could be generated by *predict.lua* (\\*_popup.txt), has the following format:\n\n```csv\nwidth height\nthe number of walls\n(Wall descriptions)\nx_1, y_1, x_2, y_2, room type on the left, room type on the right\n...\n(Opening descriptions)\nx_1, y_1, x_2, y_2, 'door', dummy, dummy\n(Icon descriptions)\nx_1, y_1, x_2, y_2, icon type, dummy, dummy\n```\n\nYou 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).\n\nThe Python code is based on Panda3D. First enter folder rendering/, and then either run:\n\n```bash\npython viewer.py\n```\n\nto view a 3D model, or run:\n\n```bash\npython rendering.py\n```\nto 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.\n\n## Contact\n\nIf you have any questions, please contact me at chenliu@wustl.edu.\n","funding_links":[],"categories":["Datasets"],"sub_categories":["Scene level"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fart-programmer%2FFloorplanTransformation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fart-programmer%2FFloorplanTransformation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fart-programmer%2FFloorplanTransformation/lists"}