YOLOplan automates symbol detection and counting in technical drawings (PDF, images, CAD) using YOLO11 object detection. Built for MEP professionals, it streamlines takeoff for electrical, HVAC, plumbing, and architectural projects fast, accurate, and production-ready.
- โ YOLO11 Integration - State-of-the-art object detection
- โ Multi-format Support - PDF, JPG, PNG, BMP, TIFF
- โ Batch Processing - Process multiple drawings simultaneously
- โ Custom Training - Train on your specific symbols
- โ Export Options - CSV, Excel, JSON with netlist support
- โ Production Ready - Comprehensive error handling & logging
- ๐ Adaptive Preprocessing - Smart enhancement based on image characteristics
- ๐ Netlist Generation - Connectivity analysis for electrical schematics
- ๐ Hyperparameter Optimization - Auto-tune training with Optuna
- ๐ Synthetic Data Generation - Augment small datasets
- ๐ Parallel Processing - 3x faster batch operations
- ๐ Comprehensive Testing - 25+ unit tests for reliability
- Electrical & MEP Engineering - Automated symbol takeoff and counting
- Construction Estimation - Rapid quantity extraction from plans
- BIM & Digital Modeling - Integration with building information models
- Facility Management - Asset inventory from as-built drawings
- QA/QC - Verify plan completeness and symbol placement
- Archival Digitization - Extract data from legacy drawings
# Clone repository
git clone https://github.com/DynMEP/YOLOplan.git
cd YOLOplan
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Verify installation
pytest test_yoloplan.py -v# Option 1: Use YOLO11 pretrained (general objects)
python YOLOplanDetector.py \
--model yolo11s.pt \
--source your_plan.pdf \
--output results \
--dpi 400
# Option 2: Download electrical symbols model from Roboflow
pip install roboflow
python -c "
from roboflow import Roboflow
rf = Roboflow(api_key='YOUR_KEY')
project = rf.workspace().project('electrical-symbols')
dataset = project.version(1).download('yolov8')
"
# Use downloaded model
python YOLOplanDetector.py \
--model electrical-symbols-1/weights/best.pt \
--source your_plan.pdf \
--export all# 1. Setup dataset structure
python YOLOplanTrainer.py setup \
--path datasets/my_symbols \
--classes outlet switch light panel
# 2. Label 20-50 images using Roboflow or LabelImg
# - Upload to roboflow.com (easiest)
# - Or use: pip install labelImg && labelImg
# 3. Train model with optimization
python YOLOplanTrainer.py train \
--data datasets/my_symbols/data.yaml \
--model s \
--epochs 100 \
--batch 16 \
--optimize \
--name my_model
# 4. Detect symbols in production
python YOLOplanDetector.py \
--model runs/train/my_model/weights/best.pt \
--source production_plans/ \
--export allYOLOplan/
โโโ YOLOplanDetector.py # Detection and inference engine
โโโ YOLOplanTrainer.py # Training pipeline
โโโ ImagePreprocessor.py # Preprocessing utilities
โโโ requirements.txt # Dependencies
โโโ test_yoloplan.py # Comprehensive test suite
โ
โโโ docs/ # Documentation
โ โโโ YOLOplan.md # Detailed usage guide
โ โโโ INSTALLATION_GUIDE.md
โ โโโ QUICK_REFERENCE.md
โ โโโ COMPLETE_FILES_SUMMARY.md
โ
โโโ datasets/ # Your training datasets
โ โโโ electrical_symbols/
โ โโโ images/
โ โ โโโ train/
โ โ โโโ val/
โ โ โโโ test/
โ โโโ labels/
โ โโโ data.yaml
โ
โโโ models/ # Model weights
โ โโโ yolo11n.pt
โ โโโ yolo11s.pt
โ โโโ best.pt
โ
โโโ runs/ # Training outputs
โ โโโ train/
โ โโโ exp/
โ โโโ weights/
โ
โโโ results/ # Detection outputs
โโโ annotated_images/
โโโ summary_*.csv
โโโ details_*.csv
โโโ netlist_*.csv
- OS: Windows 10+, Ubuntu 20.04+, macOS 10.15+
- Python: 3.8 or higher
- RAM: 8GB minimum (16GB recommended for training)
- GPU: CUDA-capable NVIDIA GPU recommended (optional)
ultralytics>=8.3.0 # YOLO11
torch>=2.0.0 # PyTorch
opencv-python>=4.8.0 # Computer vision
pandas>=2.0.0 # Data handling
PyMuPDF>=1.23.0 # PDF processing
optuna>=3.0.0 # Hyperparameter optimization
See requirements.txt for complete list.
| Model | Size | Speed | mAP50 | Best For |
|---|---|---|---|---|
| YOLO11n | 6.2 MB | 1.5 ms | 39.5% | Fast inference |
| YOLO11s | 21.5 MB | 2.3 ms | 47.0% | Production (recommended) |
| YOLO11m | 49.7 MB | 4.4 ms | 51.5% | High accuracy |
| YOLO11l | 86.9 MB | 6.2 ms | 53.4% | Maximum accuracy |
- PDF Conversion: ~2-5 seconds per page (400 DPI)
- Detection: ~50-200 ms per image (depends on model)
- Batch Processing: 3x faster with parallel processing
- Training: ~1-3 hours for 100 epochs (with GPU)
- ๐ Complete Usage Guide - Detailed documentation
- ๐ง Installation Guide - Step-by-step setup
- โก Quick Reference - Common commands
- ๐ Fixes & Improvements - Changelog
from YOLOplanDetector import YOLOplanDetector
# Initialize detector
detector = YOLOplanDetector('models/electrical.pt', conf_threshold=0.25)
# Process drawing
result = detector.detect_symbols('electrical_plan.pdf', save_annotated=True)
# Print results
print(f"Total symbols: {result['total_detections']}")
for symbol, count in result['class_counts'].items():
print(f" {symbol}: {count}")
# Export
detector.export_results([result], 'takeoff_results', format='excel')# Process entire project folder
python YOLOplanDetector.py \
--model models/electrical.pt \
--source "project_plans/*.pdf" \
--output project_takeoff \
--dpi 400 \
--conf 0.3 \
--export allfrom ImagePreprocessor import ImagePreprocessor
preprocessor = ImagePreprocessor()
preprocessor.generate_synthetic_schematic(
class_names=['outlet', 'switch', 'light', 'panel'],
output_dir='datasets/synthetic',
num_images=200,
img_size=640
)# Install testing dependencies
pip install pytest pytest-cov
# Run all tests
pytest test_yoloplan.py -v
# Run with coverage
pytest test_yoloplan.py --cov=. --cov-report=html
# Run specific test
pytest test_yoloplan.py::TestImagePreprocessor -v- โ Image preprocessing
- โ Dataset splitting & analysis
- โ Label format conversion
- โ Detection pipeline
- โ Training configuration
- โ End-to-end workflows
- โ Fixed critical bugs
- โ Comprehensive error handling
- โ Logging system
- โ Test suite
- โ Performance optimizations
- ๐ Advanced wire tracing for netlists
- ๐ Real-time detection (webcam/video)
- ๐ Web dashboard for results
- ๐ API endpoint generation
- ๐ Database export support
- ๐ฎ Multi-discipline symbol libraries
- ๐ฎ Cloud training infrastructure
- ๐ฎ BIM integration (Revit, AutoCAD)
- ๐ฎ Mobile app support
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Add tests for new features
- Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
# Clone your fork
git clone https://github.com/YOUR_USERNAME/YOLOplan.git
# Install dev dependencies
pip install -r requirements.txt
pip install pytest pytest-cov black flake8 mypy
# Run tests before committing
pytest test_yoloplan.py -vThis project is licensed under the MIT License - see the LICENSE file for details.
YOLO11 is licensed under AGPL-3.0 for open-source use. For commercial use, consider the Ultralytics Enterprise License.
- Ultralytics for YOLO11
- The open-source computer vision community
- All contributors and users of YOLOplan
- ๐ง Email: davila.alfonso@gmail.com
- ๐ Issues: GitHub Issues
- ๐ฌ Discussions: GitHub Discussions
- ๐บ YouTube: @DynMEP
- ๐ผ LinkedIn: alfonso-davila-3a121087
- ๐ GitHub: DynMEP
- ๐ Website: dynmep.com (Coming Soon)
If you use YOLOplan in your research or projects, please cite:
@software{yoloplan2025,
author = {Alfonso Davila},
title = {YOLOplan: Automated Symbol Detection for Technical Drawings},
year = {2025},
url = {https://github.com/DynMEP/YOLOplan},
version = {1.1.0},
note = {YOLO11 implementation for MEP symbol detection}
}If YOLOplan helps your work, please consider giving it a star! โญ
Your support helps maintain and improve YOLOplan!
Get Started โข Documentation โข Examples โข Contributing
Made with โค๏ธ by Alfonso Davila