polygnn
PolyGNN: Polyhedron-based graph neural network for 3D building reconstruction from point clouds [ISPRS 2024]
Science Score: 67.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 2 DOI reference(s) in README -
✓Academic publication links
Links to: sciencedirect.com, zenodo.org -
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.0%) to scientific vocabulary
Keywords
Repository
PolyGNN: Polyhedron-based graph neural network for 3D building reconstruction from point clouds [ISPRS 2024]
Basic Info
- Host: GitHub
- Owner: chenzhaiyu
- License: mit
- Language: Python
- Default Branch: main
- Homepage: https://github.com/chenzhaiyu/polygnn
- Size: 2.23 MB
Statistics
- Stars: 129
- Watchers: 10
- Forks: 14
- Open Issues: 3
- Releases: 0
Topics
Metadata Files
README.md
PolyGNN
PolyGNN is an implementation of the paper PolyGNN: Polyhedron-based Graph Neural Network for 3D Building Reconstruction from Point Clouds. PolyGNN learns a piecewise planar occupancy function, supported by polyhedral decomposition, for efficient and scalable 3D building reconstruction.
🛠️ Setup
Repository
Clone the repository:
bash
git clone https://github.com/chenzhaiyu/polygnn && cd polygnn
All-in-one installation
Create a conda environment with all dependencies:
bash
conda env create -f environment.yml && conda activate polygnn
Manual installation
Still easy! Create a conda environment and install mamba for faster parsing:
bash
conda create --name polygnn python=3.10 && conda activate polygnn
conda install mamba -c conda-forge
Install the required dependencies:
mamba install pytorch torchvision sage=10.0 pytorch-cuda=11.7 pyg=2.3 pytorch-scatter pytorch-sparse pytorch-cluster torchmetrics rtree -c pyg -c pytorch -c nvidia -c conda-forge
pip install abspy==0.2.6 hydra-core hydra-colorlog omegaconf trimesh tqdm wandb plyfile
🚀 Usage
Quick start
Download the mini dataset and pretrained weights:
python
python download.py dataset=mini
In case you encounter issues (e.g., Google Drive limits), manually download the data and weights here, then extract them into ./checkpoints/mini and ./data/mini, respectively.
The mini dataset contains 200 random instances (~0.07% of the full dataset).
Train PolyGNN on the mini dataset (provided for your reference and is not intended for full-scale training):
python
python train.py dataset=mini
The data will be automatically preprocessed the first time you initiate training.
Evaluate PolyGNN with option to save predictions:
python
python test.py dataset=mini evaluate.save=true
Generate meshes from predictions:
python
python reconstruct.py dataset=mini reconstruct.type=mesh
Remap meshes to their original CRS:
python
python remap.py dataset=mini
Generate reconstruction statistics:
python
python stats.py dataset=mini
Available configurations
```python
check available configurations for training
python train.py --cfg job
check available configurations for evaluation
python test.py --cfg job
``
Alternatively, review the configuration file:conf/config.yaml`.
Full dataset
The Munich dataset is available for download on Zenodo. Note that it requires 332 GB of storage when decompressed. Meshes for CRS remapping can be downloaded here.
Custom data
PolyGNN requires polyhedron-based graphs as input. To prepare this from your own point clouds:
1. Extract planar primitives using tools such as Easy3D or GoCoPP, preferably in VertexGroup format.
2. Build CellComplex from the primitives using abspy. Example code:
python
from abspy import VertexGroup, CellComplex
vertex_group = VertexGroup(vertex_group_path, quiet=True)
cell_complex = CellComplex(vertex_group.planes, vertex_group.aabbs,
vertex_group.points_grouped, build_graph=True, quiet=True)
cell_complex.prioritise_planes(prioritise_verticals=True)
cell_complex.construct()
cell_complex.save(complex_path)
Alternatively, you can modify CityDataset or TestOnlyDataset to accept inputs directly from VertexGroup or VertexGroupReference.
3. Structure your dataset similarly to the provided mini dataset:
bash
YOUR_DATASET_NAME
└── raw
├── 03_meshes
│ ├── DEBY_LOD2_104572462.obj
│ ├── DEBY_LOD2_104575306.obj
│ └── DEBY_LOD2_104575493.obj
├── 04_pts
│ ├── DEBY_LOD2_104572462.npy
│ ├── DEBY_LOD2_104575306.npy
│ └── DEBY_LOD2_104575493.npy
├── 05_complexes
│ ├── DEBY_LOD2_104572462.cc
│ ├── DEBY_LOD2_104575306.cc
│ └── DEBY_LOD2_104575493.cc
├── testset.txt
└── trainset.txt
4. To train or evaluate PolyGNN using your dataset, run the following commands:
```python
# start training
python train.py dataset=YOURDATASETNAME
# start evaluation
python test.py dataset=YOURDATASETNAME
``
For evaluation only, you can instantiate your dataset as a [TestOnlyDataset`](https://github.com/chenzhaiyu/polygnn/blob/67addd77a6be1d100448e3bd7523babfa063d0dd/dataset.py#L276), as in this line.
👷 TODOs
- [x] Demo with mini data and pretrained weights
- [x] Short tutorial for getting started
- [x] Host the full dataset
🎓 Citation
If you use PolyGNN in a scientific work, please consider citing the paper:
bibtex
@article{chen2024polygnn,
title = {PolyGNN: Polyhedron-based graph neural network for 3D building reconstruction from point clouds},
journal = {ISPRS Journal of Photogrammetry and Remote Sensing},
volume = {218},
pages = {693-706},
year = {2024},
issn = {0924-2716},
doi = {https://doi.org/10.1016/j.isprsjprs.2024.09.031},
url = {https://www.sciencedirect.com/science/article/pii/S0924271624003691},
author = {Zhaiyu Chen and Yilei Shi and Liangliang Nan and Zhitong Xiong and Xiao Xiang Zhu},
}
The synthetic point clouds are simulated with pyhelios. You might also want to check out abspy for 3D adaptive binary space partitioning and Points2Poly for reconstruction with deep implicit fields.
Owner
- Name: Zhaiyu Chen
- Login: chenzhaiyu
- Kind: user
- Location: Munich, Germany
- Company: Technical University of Munich
- Website: chenzhaiyu.com
- Repositories: 32
- Profile: https://github.com/chenzhaiyu
Citation (CITATION.bib)
@article{chen2024polygnn,
title = {PolyGNN: Polyhedron-based graph neural network for 3D building reconstruction from point clouds},
journal = {ISPRS Journal of Photogrammetry and Remote Sensing},
volume = {218},
pages = {693-706},
year = {2024},
issn = {0924-2716},
doi = {https://doi.org/10.1016/j.isprsjprs.2024.09.031},
url = {https://www.sciencedirect.com/science/article/pii/S0924271624003691},
author = {Zhaiyu Chen and Yilei Shi and Liangliang Nan and Zhitong Xiong and Xiao Xiang Zhu},
}
GitHub Events
Total
- Issues event: 29
- Watch event: 44
- Issue comment event: 54
- Push event: 7
- Pull request event: 2
- Fork event: 8
Last Year
- Issues event: 29
- Watch event: 44
- Issue comment event: 54
- Push event: 7
- Pull request event: 2
- Fork event: 8
Committers
Last synced: 9 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Zhaiyu Chen | z****n@o****m | 17 |
| esaskhan | e****n@g****m | 1 |
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 23
- Total pull requests: 2
- Average time to close issues: about 2 months
- Average time to close pull requests: 8 days
- Total issue authors: 18
- Total pull request authors: 1
- Average comments per issue: 2.0
- Average comments per pull request: 10.0
- Merged pull requests: 2
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 16
- Pull requests: 2
- Average time to close issues: 12 days
- Average time to close pull requests: 8 days
- Issue authors: 14
- Pull request authors: 1
- Average comments per issue: 2.19
- Average comments per pull request: 10.0
- Merged pull requests: 2
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- ac416 (3)
- chl916185 (2)
- hcscysh (2)
- duyuhang129 (1)
- ces0157 (1)
- PaulLiuYZ (1)
- boxiao-wv (1)
- rujialiu (1)
- dyh9980 (1)
- kuaiqushangzixiba (1)
- rorrewang (1)
- ellkrauze (1)
- Rolin-zrl (1)
- Crasl003 (1)
- eyegotthis (1)
Pull Request Authors
- eyegotthis (2)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- abspy ==0.2.4
- addict ==2.4.0
- antlr4-python3-runtime ==4.9.3
- appdirs ==1.4.4
- blinker ==1.7.0
- click ==8.1.7
- colorlog ==6.7.0
- configargparse ==1.7
- dash ==2.16.1
- dash-core-components ==2.0.0
- dash-html-components ==2.0.0
- dash-table ==5.0.0
- docker-pycreds ==0.4.0
- embreex ==2.17.7.post3
- flask ==3.0.2
- gitdb ==4.0.10
- gitpython ==3.1.37
- hydra-colorlog ==1.2.0
- hydra-core ==1.3.2
- ipywidgets ==8.1.2
- itsdangerous ==2.1.2
- jinja2 ==3.1.3
- jupyterlab-widgets ==3.0.10
- lightning-utilities ==0.9.0
- omegaconf ==2.3.0
- open3d ==0.18.0
- pandas ==2.2.1
- pathtools ==0.1.2
- pillow ==10.2.0
- plotly ==5.19.0
- plyfile ==1.0.1
- protobuf ==4.24.3
- pyg-lib ==0.3.1
- pyquaternion ==0.9.9
- pywavefront ==1.3.3
- pyyaml ==6.0.1
- retrying ==1.3.4
- sage-docbuild ==9.4
- sagemath-standard ==9.4
- sentry-sdk ==1.31.0
- setproctitle ==1.3.2
- setuptools ==66.0.0
- smmap ==5.0.1
- tenacity ==8.2.3
- torch-cluster ==1.6.3
- torch-geometric ==2.4.0
- torch-scatter ==2.1.2
- torch-sparse ==0.6.18
- torch-spline-conv ==1.2.2
- torchmetrics ==1.3.0.dev0
- trimesh ==3.23.5
- tzdata ==2024.1
- wandb ==0.15.11
- werkzeug ==3.0.1
- widgetsnbextension ==4.0.10