This project implements a deep learning model for automatic wall detection in architectural floor plans using the DeepLabV3+ architecture. The model is trained on the zimhe/pseudo-floor-plan-12k dataset from HuggingFace.
- Multiple Detection Methods: UNet, DeepLabV3+, and direct image processing
- Wall Coordinate Extraction: Converts wall masks to line coordinates
- 3D Visualization Ready: Outputs coordinates in JSON format for 3D rendering
| Model | Advantages | Use Case |
|---|---|---|
| UNet (UnetModel.ipynb) | 🚀 Faster training 🎯 Better accuracy 🧠 Lower memory usage |
Recommended for all wall detection tasks |
| DeepLabV3+ (main.py) | 🔍 Higher capacity 🌐 Pre-trained backbone |
Complex floor plans with many details |
| Direct Processing | ⚡ No training required 📊 Works on binary images |
When you already have wall masks |
git clone https://github.com/Divak-ar/floorData.git
cd floorData# For Windows
python -m venv .venv
.venv\Scripts\activate
# For macOS/Linux
python3 -m venv .venv
source .venv/bin/activatepip install -r requirements.txtThe project uses the pseudo-floor-plan-12k dataset from HuggingFace. To download the dataset:
python dataDownload.pyThis will:
- Download 100 floor plan images and their corresponding wall masks
- Save them in the
huggingface_datasetdirectory
python main.pyThe training process:
- Loads and preprocesses floor plan images and wall masks
- Splits data into training and validation sets
- Trains a DeepLabV3+ model with ResNet50 backbone
- Saves the best model during training
- Visualizes prediction results
Open and run the UnetModel.ipynb notebook for better wall detection results.
from main import predict_on_new_image
from tensorflow.keras.models import load_model
# Load trained model
model = load_model('huggingface_dataset/model/deeplab_walls_best.h5')The wall detection model uses a DeepLabV3+ architecture with:
- ResNet50 backbone pre-trained on ImageNet
- Atrous Spatial Pyramid Pooling (ASPP) module
- Decoder with skip connections from encoder
- Binary segmentation output (walls vs. background)
The UNet model typically achieves:
- Higher IoU (Intersection over Union) for wall segmentation
- Better line detection accuracy
- Faster inference time
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
