Spaces:
Runtime error
Runtime error
| title: Floor Plan Segmentation | |
| emoji: 🏠 | |
| colorFrom: blue | |
| colorTo: indigo | |
| sdk: gradio | |
| sdk_version: "5.23.0" | |
| app_file: app.py | |
| pinned: false | |
| license: mit | |
| # Floor Plan Segmentation API | |
| Segments rooms, walls, doors, and windows from floor plan images. | |
| ## Models | |
| - **Primary**: Mask2Former instance segmentation (pre-trained on floor plans) | |
| - **Fallback**: OpenCV contour-based detection (no GPU needed) | |
| ## API Usage | |
| ```python | |
| import requests | |
| # Via Gradio API | |
| response = requests.post( | |
| "https://<space-name>.hf.space/api/predict", | |
| json={"data": ["<base64_image>"]} | |
| ) | |
| result = response.json() | |
| ``` | |
| ## Output Format | |
| All coordinates are **normalized** (0.0 to 1.0): | |
| ```json | |
| { | |
| "rooms": [{"name": "Wohnzimmer", "type": "living_room", "boundary": [{"x": 0.1, "y": 0.2}, ...], "confidence": 0.85}], | |
| "walls": [{"start": {"x": 0.0, "y": 0.1}, "end": {"x": 0.5, "y": 0.1}, "is_exterior": true}], | |
| "doors": [{"position": {"x": 0.3, "y": 0.5}, "width_mm": 900, "type": "standard"}], | |
| "windows": [], | |
| "_coordSystem": "normalized", | |
| "_version": "hf-space-v1" | |
| } | |
| ``` | |