Spaces:
Runtime error
Runtime error
A newer version of the Gradio SDK is available: 6.14.0
metadata
title: House Model Detaction
emoji: 🏃
colorFrom: green
colorTo: blue
sdk: gradio
sdk_version: 5.25.2
app_file: app.py
pinned: false
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
Architectural Floor Plan Analyzer
This Hugging Face Space allows users to upload PDF floor plans and get detailed room-level information in structured JSON format. The application uses Google's Gemini Pro Vision model to analyze the floor plans and extract structured data.
Features
- Upload PDF floor plans
- Extract images from PDFs
- Analyze floor plans using Gemini Pro Vision
- Get structured JSON output with room details
- Optional description field for additional context
Setup Instructions
1. Create a Hugging Face Space
- Go to Hugging Face
- Click on "Create new Space"
- Select "Gradio" as the SDK
- Choose a name for your Space (e.g., "floor-plan-analyzer")
- Set Space visibility (Public or Private)
- Create the Space
2. Add Environment Variables
You need to add your Gemini API key as an environment variable:
- Go to your Space's settings
- Click on "Repository secrets"
- Add a new secret:
- Name:
GEMINI_API_KEY - Value: Your Gemini API key from Google AI Studio
- Name:
3. Upload Files
Upload the following files to your Space:
app.py(the main application)requirements.txt(dependencies)
You can do this through the Hugging Face web interface or by pushing to the git repository.
Usage
- Open your Hugging Face Space
- Upload a PDF floor plan
- (Optional) Add a description with additional details
- Click "Analyze Floor Plan"
- View the extracted images and JSON output
JSON Output Format
The output is a structured JSON array with detailed room information:
[
{
"name": "Room name",
"area_m2": 0.0,
"position": "approximate location (e.g., north, south-east corner)",
"dimensions_m": {
"width": 0.0,
"length": 0.0
},
"windows": 0,
"window_positions": ["north wall", "east wall"],
"doors": 0,
"door_positions": ["interior", "to terrace"],
"connected_rooms": ["Room A", "Room B"],
"has_external_access": true,
"ceiling_height_m": 2.4,
"furniture": ["sofa", "kitchen island"],
"estimated": false
}
]
Limitations
- The quality of the analysis depends on the clarity and quality of the uploaded floor plan
- The application works best with clearly labeled floor plans
- Large or complex floor plans may take longer to process
- Gemini may need to estimate some values if they're not explicitly labeled in the plan
Troubleshooting
- If you encounter errors related to the API key, ensure the
GEMINI_API_KEYenvironment variable is set correctly - If the PDF fails to process, try converting it to a clearer format or using a different PDF
- For any other issues, check the error messages in the application output