This is a demo code for our paper "LC2WF:Learning to Construct 3D Building Wireframes from 3D Line Clouds", accepted to BMVC 2022, by Yicheng Luo, Jing Ren, Xuefei Zhe, Di Kang, Yajing Xu, Peter Wonka, and Linchao Bao.
In this work, we propose the first network to process line clouds for building wireframe abstraction. The network takes a line cloud as input , i.e., a nonstructural and unordered set of 3D line segments extracted from multi-view images, and outputs a 3D wireframe of the underlying building, which consists of a sparse set of 3D junctions connected by line segments. We observe that a line patch, i.e., a group of neighboring line segments, encodes sufficient contour information to predict the existence and even the 3D position of a potential junction, as well as the likelihood of connectivity between two query junctions. We therefore introduce a two-layer Line-Patch Transformer to extract junctions and connectivities from sampled line patches to form a 3D building wireframe model. We also introduce a synthetic dataset of multi-view images with ground-truth 3D wireframe.
You can find more details at: [paper] | [dataset and models] | [suppl.]
- torch 1.8.0
- torchvision 0.9.0
- cuda: 10.0
- python 3.8.8
url | |
---|---|
pretrained-model | [Google Drive] / [BaiduYun](code:engt) |
dataset | [Google Drive] / [BaiduYun](code:p9kb) |
mvs-image | [[Google Drive]] / [BaiduYun](code:tdnf) |
- Clone repository
git clone https://github.com/Luo1Cheng/LC2WF.git
-
Download line cloud data and pre-trained model.
-
Unzip files
unzip LC2wf_data.zip
unzip pretrained.zip
- Your directory will be like
|----LC2WF_data
| |----house
| |----LineCloud_0130_P123
| |----test.txt
| |----train.txt
|----pretrained
| |----junction.pth
| |----edge.pth
|...
- To evaluate the model:
python train.py --yamlName evalJunc
python trainClassify.py --yamlName evalWireframe
cd eval_results
python ours_eval.py
- The predicted wireframe obj files are in ./eval_results/finalOutOBJ. You can open them with MeshLab
-
Clone repository
git clone https://github.com/Luo1Cheng/LC2WF.git
-
Download line cloud data from [Google Drive] or [Baidu Disk](code:p9kb)
-
Unzip the files.
unzip LC2wf_data.zip
-
Train the junction prediction model first
python train.py --yamlName train
-
Change the
load_model
inconfig/genPredJunc.yaml
to yourjunction_best.pth
, which will be saved inlog/***/saved_models
folder. -
Generate the predicted junctions of the training and test dataset
python train.py --yamlName genPredJunc
-
Train the connectivity prediction model
python trainClassify.py
-
The best model will be saved in
log/***/saved_models
folder.
- We use Line3D++ for line cloud extraction: [paper] | [code]
- "PolyFit: Polygonal Surface Reconstruction from Point Clouds", Liangliang Nan and Peter Wonka, ECCV2017. [project page]
- "PC2WF: 3D Wireframe Reconstruction from Raw Point Clouds", Yujia Liu, Stefano D'Aronco, Konrad, Schindler, Jan Dirk Wegner, ICLR2021. [paper] | [code]
- "Line2Surf: Surface Reconstruction from 3D Line Segments", Pierre-Alain Langlois, Alexandre Boulch, Renaud Marlet, 3DV2019. [paper] | [code]
- Our dataset is adapted from the paper "Intuitive and Efficient Roof Modeling for Reconstruction and Synthesis"
If you use this code/dataset for your research, please cite our paper:
@InProceedings{luo2022LC2WF,
author = "Yicheng Luo, Jing Ren, Xuefei Zhe, Di Kang, Yajing Xu, Peter Wonka, and Linchao Bao",
title = "LC2WF:Learning to Construct 3D Building Wireframes from 3D Line Clouds",
booktitle = "Proceedings of the British Machine Vision Conference (BMVC)",
year = 2022
}