Update 2DPlan2Strct model card and inference default
Browse files- README.md +15 -9
- inference.py +1 -1
README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
---
|
| 2 |
language: en
|
| 3 |
-
model_name:
|
| 4 |
pipeline_tag: object-detection
|
| 5 |
tags:
|
| 6 |
- floor-plan
|
|
@@ -11,10 +11,12 @@ metrics:
|
|
| 11 |
- map
|
| 12 |
license: other
|
| 13 |
license_name: non-commercial-research-only
|
| 14 |
-
license_link: https://huggingface.co/OsamaMo/
|
| 15 |
---
|
| 16 |
|
| 17 |
-
#
|
|
|
|
|
|
|
| 18 |
|
| 19 |
Detect **walls, rooms, doors, and windows** in 2D floor-plan images. Inference runs locally after the weights are downloaded from Hugging Face. It returns a JSON file with detections and an annotated PNG. Walls and rooms are represented by bounding boxes, not segmentation masks.
|
| 20 |
|
|
@@ -22,8 +24,8 @@ Detect **walls, rooms, doors, and windows** in 2D floor-plan images. Inference r
|
|
| 22 |
|
| 23 |
| Before detection | After detection |
|
| 24 |
| :---: | :---: |
|
| 25 |
-
| 
|
| 127 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 128 |
## Download tracking
|
| 129 |
|
| 130 |
Hugging Face displays a download count on this model page. The script retrieves `config.json`, which the Hub counts as a model download. The count represents file requests, **not unique people** or model-card readers. To retrieve the current count programmatically:
|
|
@@ -132,6 +138,6 @@ Hugging Face displays a download count on this model page. The script retrieves
|
|
| 132 |
```python
|
| 133 |
from huggingface_hub import HfApi
|
| 134 |
|
| 135 |
-
info = HfApi().model_info("OsamaMo/
|
| 136 |
print(info.downloads)
|
| 137 |
```
|
|
|
|
| 1 |
---
|
| 2 |
language: en
|
| 3 |
+
model_name: 2DPlan2Strct
|
| 4 |
pipeline_tag: object-detection
|
| 5 |
tags:
|
| 6 |
- floor-plan
|
|
|
|
| 11 |
- map
|
| 12 |
license: other
|
| 13 |
license_name: non-commercial-research-only
|
| 14 |
+
license_link: https://huggingface.co/OsamaMo/2dplan2strct/blob/main/USAGE_TERMS.md
|
| 15 |
---
|
| 16 |
|
| 17 |
+
# 2DPlan2Strct
|
| 18 |
+
|
| 19 |
+
### From Floor Plan Images to Structured Architectural Understanding
|
| 20 |
|
| 21 |
Detect **walls, rooms, doors, and windows** in 2D floor-plan images. Inference runs locally after the weights are downloaded from Hugging Face. It returns a JSON file with detections and an annotated PNG. Walls and rooms are represented by bounding boxes, not segmentation masks.
|
| 22 |
|
|
|
|
| 24 |
|
| 25 |
| Before detection | After detection |
|
| 26 |
| :---: | :---: |
|
| 27 |
+
|  |  |
|
| 28 |
+
|  |  |
|
| 29 |
|
| 30 |
## Quick start
|
| 31 |
|
|
|
|
| 33 |
|
| 34 |
```bash
|
| 35 |
python -m pip install "huggingface_hub>=0.25"
|
| 36 |
+
hf download OsamaMo/2dplan2strct inference.py requirements.txt --local-dir floorplan-inference
|
| 37 |
python -m pip install -r floorplan-inference/requirements.txt
|
| 38 |
python floorplan-inference/inference.py path/to/plan.png --output-dir results/plan
|
| 39 |
```
|
|
|
|
| 83 |
Download the configuration and checkpoint while online, then point the inference script at the local directory:
|
| 84 |
|
| 85 |
```bash
|
| 86 |
+
hf download OsamaMo/2dplan2strct config.json checkpoint_best_ema.pth --local-dir floorplan-model
|
| 87 |
python floorplan-inference/inference.py path/to/plan.png --model-dir floorplan-model --output-dir results/plan
|
| 88 |
```
|
| 89 |
|
|
|
|
| 112 |
To measure both devices on your own machine, download `benchmark.py` alongside `inference.py`, then run:
|
| 113 |
|
| 114 |
```bash
|
| 115 |
+
hf download OsamaMo/2dplan2strct benchmark.py inference.py --local-dir floorplan-inference
|
| 116 |
python floorplan-inference/benchmark.py path/to/plan.png --device both --warmups 3 --repeats 20
|
| 117 |
```
|
| 118 |
|
|
|
|
| 127 |
- Default confidence threshold: `0.35`; tune for your drawings
|
| 128 |
- Supported use: non-commercial research and evaluation, subject to [usage terms](USAGE_TERMS.md)
|
| 129 |
|
| 130 |
+
## Training setup
|
| 131 |
+
|
| 132 |
+
The model was trained on an NVIDIA T4 GPU with 16 GB of memory. The reported training duration was 16 hours.
|
| 133 |
+
|
| 134 |
## Download tracking
|
| 135 |
|
| 136 |
Hugging Face displays a download count on this model page. The script retrieves `config.json`, which the Hub counts as a model download. The count represents file requests, **not unique people** or model-card readers. To retrieve the current count programmatically:
|
|
|
|
| 138 |
```python
|
| 139 |
from huggingface_hub import HfApi
|
| 140 |
|
| 141 |
+
info = HfApi().model_info("OsamaMo/2dplan2strct")
|
| 142 |
print(info.downloads)
|
| 143 |
```
|
inference.py
CHANGED
|
@@ -17,7 +17,7 @@ from PIL import Image, ImageDraw
|
|
| 17 |
from rfdetr import RFDETRMedium
|
| 18 |
|
| 19 |
|
| 20 |
-
DEFAULT_REPO_ID = "OsamaMo/
|
| 21 |
COLORS = {
|
| 22 |
"wall": "#e63946",
|
| 23 |
"room": "#457b9d",
|
|
|
|
| 17 |
from rfdetr import RFDETRMedium
|
| 18 |
|
| 19 |
|
| 20 |
+
DEFAULT_REPO_ID = "OsamaMo/2dplan2strct"
|
| 21 |
COLORS = {
|
| 22 |
"wall": "#e63946",
|
| 23 |
"room": "#457b9d",
|