An AI-powered tool to analyze engineering drawings using open-source vision models (Ollama + LLaVA). Load drawings, ask questions, and get detailed analysis - all running locally on your machine!
- 🎯 Analyze engineering drawings with natural language prompts
- 🖼️ Support for single or multiple drawings
- 🔒 100% Local & Private - runs entirely on your machine using open-source models
- 💰 Free - no API costs or subscriptions
- 🚀 Multiple vision models supported (LLaVA, BakLLaVA, Moondream)
- 📊 Extract dimensions, specifications, and technical details
- 🔍 Identify components, materials, and design features
- ⚡ Interactive mode for multiple queries
Ollama is required to run the open-source vision models locally.
macOS:
brew install ollamaLinux:
curl -fsSL https://ollama.ai/install.sh | shWindows: Download from https://ollama.ai
ollama serve# Recommended: LLaVA (best for engineering drawings)
ollama pull llava
# Alternative models:
# ollama pull bakllava # Good for detailed analysis
# ollama pull moondream # Lightweight and fast- Clone or download this repository
- Install Python dependencies:
pip install -r requirements.txtAnalyze a single drawing:
python main.py path/to/drawing.png -p "What are the main dimensions shown in this drawing?"Analyze multiple drawings:
python main.py drawing1.png drawing2.png -p "Compare these two designs"Use a different model:
python main.py drawing.png -p "List all components" -m bakllavapython -c "from main import interactive_mode; interactive_mode()"Then enter your drawing path(s) and ask multiple questions interactively.
from drawing_analyzer import DrawingAnalyzer
# Initialize analyzer
analyzer = DrawingAnalyzer(model="llava")
# Analyze a drawing
result = analyzer.analyze_drawing(
"path/to/drawing.png",
"What materials are specified in this drawing?"
)
print(result)
# Analyze multiple drawings
result = analyzer.analyze_multiple_drawings(
["drawing1.png", "drawing2.png"],
"What are the differences between these designs?"
)
print(result)- "What are the main dimensions in this engineering drawing?"
- "List all the components shown in this assembly"
- "What material specifications are indicated?"
- "Identify any tolerances or technical requirements"
- "What type of engineering drawing is this (orthographic, isometric, etc.)?"
- "Extract the title block information"
- "Are there any welding symbols or surface finish specifications?"
- PNG
- JPEG/JPG
- BMP
- GIF
- TIFF
| Model | Size | Speed | Quality | Best For |
|---|---|---|---|---|
| llava | ~4.5GB | Medium | High | General engineering drawings |
| bakllava | ~4.5GB | Medium | Very High | Detailed technical analysis |
| moondream | ~1.6GB | Fast | Good | Quick reviews, lighter workloads |
You can set environment variables in a .env file:
OLLAMA_MODEL=llava
OLLAMA_BASE_URL=http://localhost:11434- Ensure Ollama is running:
ollama serve - Check if the service is accessible:
curl http://localhost:11434/api/tags
- Pull the model first:
ollama pull llava - Check available models:
ollama list
- Try a smaller model like
moondream - Ensure you have adequate RAM (8GB+ recommended)
- Close other resource-intensive applications
- Python 3.8+
- Ollama installed and running
- At least one vision model pulled (llava, bakllava, or moondream)
- 8GB+ RAM recommended
MIT License - feel free to use and modify!
All analysis happens locally on your machine. No data is sent to external servers, ensuring your engineering drawings remain private and secure.