Ziniu Luo, Weixin Huang*
School of Architecture, Tsinghua University, Beijing, China
Code and instruction for our Automation in Construction submission:"FloorplanGAN: Vector Residential Floorplan Adversarial Generation".
FloorplanGAN is a domain specific GAN combines Vector Generator and Raster Discriminator. It aims to synthesis vector residential floorplans based on Adversiral Generation, Differentiable Rendering and Self-Attention, etc.
- dependency
(base)$ conda create -n floorplangan python=3.8 -y
(base)$ conda activate floorplangan
(floorplangan)$ pip install -r requirements.txt
we use a publicly available dataset RPlan (http://staff.ustc.edu.cn/~fuxm/projects/DeepLayout/index.html), which contains 80k+ well annotated real residential floorplans in PNG format.
After the filtering and vectorization (using Pyportace) described in our paper, we get a training set of 17154 samples and a test set of 2000 samples, all in vector format. The preprocessed data can be download from baiduyun or google drive.
Make directory data_FloorplanGAN
in root directory of this project, and unzip the downloaded zipfile in this folder.
Directory structures should be like:
FloorplanGAN
|---data_FloorplanGAN
| |---names
| `---pkls
|---main.py
|---models.py
|---dataset.py
...
modify config.yaml
to meet your demand:
- NUM_GPUS: number of GPUs used in training.
- NUM_WORKERS: number of CPU cores used in data loading.
- BATCHSIZE: change the batchsize according to the GPU memory.
Others are supposed to remain unchanged.
- Train with single GPU
(floorplangan)$ python main.py
- Or multi-GPUs (e.g. 4 GPUs)
(floorplangan)$ torchrun --nproc_per_node=4 main.py
- Visualize the training process
(floorplangan)$ tesorboard --logidr=runs_rplan
Follow the instruction in test.ipynb
Coming soon...
Coming soon...
- luozn15@qq.com (Z. Luo)
- wxhuang@mail.tsinghua.edu.cn (W. Huang*)
This work is supported by the grant No.52178019 of National Science Foundation of China.We would like to thank the architects and master students of architecture for participating in our user study.