|
Download README.md from digitalpresso/floorplan-dfine-obj: direct link, hf CLI and curl.
- Browser
- Download file 8.49 kB
-
https://huggingface.co/digitalpresso/floorplan-dfine-obj/resolve/main/README.md
- Command line
-
hf download hf://digitalpresso/floorplan-dfine-obj/README.md
-
curl -L -o README.md https://huggingface.co/digitalpresso/floorplan-dfine-obj/resolve/main/README.md
8.49 kB
| license: apache-2.0 | |
| library_name: pytorch | |
| pipeline_tag: object-detection | |
| tags: | |
| - object-detection | |
| - floor-plan | |
| - architecture | |
| - d-fine | |
| - document-analysis | |
| - swiss-dwellings | |
| # Training data (no HF dataset ids): AI-Hub 71465 (Korea, not redistributed), | |
| # Swiss Dwellings v3.0.0 (Zenodo 10.5281/zenodo.7788422, CC BY 4.0). | |
| # floorplan-dfine-obj โ floor-plan fixtures detector (D-FINE-M) | |
| Object detector for architectural floor-plan drawings, **OBJ โ fixtures layer**. It is one of three | |
| sibling models that share one class taxonomy (`config.json -> id2label`), so their outputs can be merged | |
| into a single page parse: [digitalpresso/floorplan-dfine-str](https://huggingface.co/digitalpresso/floorplan-dfine-str), [digitalpresso/floorplan-dfine-spa](https://huggingface.co/digitalpresso/floorplan-dfine-spa). | |
| - Architecture: D-FINE-M (HGNetv2-B2), 19.9 M parameters, 128 queries, 80 MB (safetensors) | |
| - Input: 1920 x 1920 tiles of full-resolution drawings (25 % overlap), see *How to use* | |
| - Initialization: official **COCO-only** D-FINE-M checkpoint (no Objects365 lineage) | |
| - Weights: training seed 0 (g1scan s0 (ep6g1scan)); metrics below also give the 3-seed spread | |
| ## Classes | |
| | id | name | | |
| |---|---| | |
| | 23 | toilet | | |
| | 24 | washbasin | | |
| | 25 | bathtub | | |
| | 26 | sink | | |
| | 27 | stove | | |
| Ids follow the shared taxonomy (id = taxonomy index + 1), which is why this model's ids do not start at 1. | |
| ## How to use | |
| Drawings are large and symbols are small, so inference must reproduce the training protocol: | |
| **1920 px tiles with 25 % overlap**, per-tile detection, then per-class NMS across tiles. | |
| `inference/infer.py` does this. It needs the *unmodified* upstream D-FINE source (Apache-2.0) pinned to | |
| commit `956d170`; the released weights load into it with `strict=True`. | |
| ```bash | |
| git clone https://huggingface.co/digitalpresso/floorplan-dfine-obj && cd floorplan-dfine-obj | |
| git clone https://github.com/Peterande/D-FINE && git -C D-FINE checkout 956d170 | |
| pip install -r inference/requirements.txt | |
| python inference/infer.py --dfine-root D-FINE --image examples/example_01.png \ | |
| --out detections.json --viz detections_viz.png | |
| ``` | |
| Output: JSON list of `{"label", "category_id", "bbox": [x, y, w, h], "score"}` in page pixels. | |
| Defaults (score > 0.3, NMS IoU 0.6) are in `config.json`. `--drop-truncated` additionally | |
| removes cut-off fragments at interior tile edges; it is off by default because the metrics below were measured without it. | |
| Add `--device cpu` (or `cuda:0`) to choose the device; a 2048 px page takes a few seconds on CPU. | |
| ## Evaluation | |
| Mean ยฑ standard deviation over **3 training seeds**; this repository contains seed 0 (last column). | |
| | Benchmark | Metric | 3 seeds, mean ยฑ sd | **This release (seed 0)** | | |
| |---|---|---|---| | |
| | Korean held-out test (1,010 drawings, AI-Hub 71465 derived) | mAP@0.5 | 0.977 ยฑ 0.001 | 0.976 | | |
| | Swiss Dwellings val | mAP@0.5 | 0.974 ยฑ 0.002 | 0.976 | | |
| | Swiss Dwellings val | mAP@0.5:0.95 | 0.969 ยฑ 0.002 | 0.969 | | |
| - Korean held-out test: a frozen, de-duplicated test set built from AI-Hub dataset 71465, never used for training or | |
| model selection. Classes that belong to another layer and appear only by accident in this task's ground truth are excluded | |
| from the average (a single such box would otherwise move the macro average by more than 0.1). | |
| - Swiss / SYNBUILD: validation splits of our rasterized versions, split by site (Swiss) or by building (SYNBUILD), | |
| so no building appears in both train and validation. | |
| Per-class AP@0.5, seed 0, Swiss Dwellings val: | |
| | Class | AP@0.5 | GT boxes | | |
| |---|---|---| | |
| | toilet | 0.977 | 5,682 | | |
| | washbasin | 0.976 | 5,977 | | |
| | bathtub | 0.973 | 4,034 | | |
| Per-class AP@0.5, seed 0, Korean held-out test: | |
| | Class | AP@0.5 | | |
| |---|---| | |
| | toilet | 0.971 | | |
| | washbasin | 0.981 | | |
| | sink | 0.963 | | |
| | stove | 0.986 | | |
| | bathtub | 0.979 | | |
| ## Limitations | |
| - Swiss render contains toilet / washbasin / bathtub only (no sink or stove); `sink` and `stove` are learned | |
| from AI-Hub alone and are not evaluated on Swiss. | |
| - Fixtures drawn as unusual symbols (e.g. wall-hung or corner units in different conventions) may be missed. | |
| - **Drawing conventions.** Trained on Korean apartment plans (AI-Hub), Swiss apartments and synthetic | |
| buildings. Plans with very different drafting conventions (hatching styles, CAD colour schemes, | |
| hand-drawn sketches) are out of distribution. | |
| - **Scale.** In the training data a door is roughly 60-70 px long. Rasters at a much lower resolution should | |
| be upscaled to about that scale before inference. | |
| - **Scan quality.** Trained with a scan / re-print degradation augmentation (applied to half of the training | |
| tiles: resolution loss, blur, paper and ink level shifts, noise, JPEG artefacts). Strongly degraded scans, | |
| especially downscaled ones, still increase missed and spurious boxes. | |
| - Detection only: no room polygons, no text/OCR, no dimension reading. | |
| ## Training data | |
| | Source | License | Training tiles | | |
| |---|---|---| | |
| | AI-Hub ๊ฑด์ถ ๋๋ฉด ๋ฐ์ดํฐ (71465), NIA, Korea | AI-Hub terms (model release permitted with attribution; data not redistributed) | 134,053 | | |
| | Swiss Dwellings v3.0.0 (Zenodo 10.5281/zenodo.7788422, Archilyse AG), rasterized by us | CC BY 4.0 | 18,070 | | |
| Swiss has no sink/stove; the loss for those classes is masked on Swiss tiles. | |
| Training: 6 epochs, AdamW, batch 12, strong augmentation for the first 2 epochs, scan / re-print degradation | |
| augmentation on half of the tiles, 1920 px tiles. | |
| ### Datasets and acknowledgements | |
| - ๊ฑด์ถ ๋๋ฉด ๋ฐ์ดํฐ (Architectural Drawing Data), [AI-Hub dataset #71465](https://www.aihub.or.kr/aihubdata/data/view.do?dataSetSn=71465), NIA, Korea. AI-Hub terms of use. | |
| - [Swiss Dwellings v3.0.0](https://doi.org/10.5281/zenodo.7788422), Standfest et al., Archilyse AG. [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/). | |
| This research used datasets from 'The Open AI Dataset Project (AI-Hub, S. Korea)'. | |
| All data information can be accessed through 'AI-Hub (www.aihub.or.kr)'. | |
| > ์ด ์ฐ๊ตฌ๋ ๊ณผํ๊ธฐ์ ์ ๋ณดํต์ ๋ถ์ ์ฌ์์ผ๋ก ํ๊ตญ์ง๋ฅ์ ๋ณด์ฌํ์งํฅ์์ ์ง์์ ๋ฐ์ ๊ตฌ์ถ๋ "๊ฑด์ถ ๋๋ฉด ๋ฐ์ดํฐ"๋ฅผ | |
| > ํ์ฉํ์ฌ ์ํ๋ ์ฐ๊ตฌ์ ๋๋ค. ๋ณธ ์ฐ๊ตฌ์ ํ์ฉ๋ ๋ฐ์ดํฐ๋ AI ํ๋ธ(aihub.or.kr)์์ ๋ค์ด๋ก๋ํ ์ ์์ต๋๋ค. | |
| No AI-Hub data is redistributed here. The datasets keep their own licenses; the Apache-2.0 license of this | |
| repository does not relicense them. The dataset creators do not endorse this work. | |
| If you use these models, please also cite the work they are built on: | |
| ```bibtex | |
| @misc{peng2024dfine, | |
| title = {D-FINE: Redefine Regression Task in DETRs as Fine-grained Distribution Refinement}, | |
| author = {Yansong Peng and Hebei Li and Peixi Wu and Yueyi Zhang and Xiaoyan Sun and Feng Wu}, | |
| year = {2024}, | |
| eprint = {2410.13842}, | |
| archivePrefix = {arXiv}, | |
| primaryClass = {cs.CV} | |
| } | |
| @dataset{standfest_swiss_dwellings_v3, | |
| author = {Standfest, Matthias and Franzen, Michael and Schrรถder, Yvonne and Gonzalez Medina, Luis and Villanueva Hernandez, Yarilo and Buck, Jan Hendrik and Tan, Yen-Ling and Niedzwiecka, Milena and Colmegna, Rachele}, | |
| title = {Swiss Dwellings: A large dataset of apartment models including aggregated geolocation-based simulation results covering viewshed, natural light, traffic noise, centrality and geometric analysis}, | |
| publisher = {Zenodo}, | |
| version = {3.0.0}, | |
| year = {2023}, | |
| doi = {10.5281/zenodo.7788422} | |
| } | |
| ``` | |
| Training tiles are 1920 px crops (Swiss: 2048 px mosaics of floor plans). | |
| ## Examples | |
| `examples/example_01.png`, `example_02.png`: 2048 px mosaics of validation floor plans from Swiss Dwellings | |
| (CC BY 4.0, Archilyse AG), rasterized by us from the published vector geometry. `example_01_pred.png` is this model's output on example_01. | |
| ## License and attribution | |
| Code (training, data conversion, evaluation, benchmarks): <https://github.com/Digitalpresso-ai/floorplan-global> | |
| Weights and code: **Apache License 2.0** (see `LICENSE`, `NOTICE`). Copyright 2026 digitalpresso | |
| Third-party attributions (D-FINE and the datasets above) are listed in `NOTICE`. | |
| ## Citation | |
| ```bibtex | |
| @misc{floorplan_dfine_obj_2026, | |
| title = {floorplan-dfine-obj: D-FINE floor-plan fixtures detector}, | |
| author = {digitalpresso}, | |
| year = {2026}, | |
| howpublished = {Hugging Face model repository}, | |
| url = {https://huggingface.co/digitalpresso/floorplan-dfine-obj} | |
| } | |
| ``` | |