Transform 2D images into stunning 3D meshes using AI-powered depth estimation and advanced edge detection โจ
๐ Quick Start | ๐ธ Features | ๐ ๏ธ Installation | ๐ Documentation | ๐ฏ Examples
EdgeMesh is a powerful PyQt6-based desktop application that converts 2D images into 3D meshes using state-of-the-art depth estimation models and sophisticated edge detection algorithms. Whether you're a 3D artist, game developer, researcher, or hobbyist, EdgeMesh provides an intuitive interface for creating detailed 3D models from ordinary photographs.
- ๐ผ๏ธ Convert any image to a 3D mesh in seconds
- ๐ง AI-powered depth estimation using multiple models (MiDaS, DPT, ZoeDepth, Depth-Anything)
- ๐จ Advanced edge detection with customizable parameters
- ๐ง Real-time 3D preview with interactive viewport
- ๐ Export to standard formats (.obj, .stl) for 3D printing or modeling software
- ๐ฎ SpaceMouse support for professional 3D navigation
- Smart Background Removal - Automatically detects and removes backgrounds based on corner colors
- Edge Detection - Advanced Canny edge detection with adjustable thresholds
- Multiple Smoothing Methods - Gaussian, Bilateral, Median, and Anisotropic Diffusion
- Grayscale Conversion - Process images in grayscale for enhanced control
- Dynamic Depth Adjustment - Create front-half meshes perfect for 3D printing
Choose from multiple state-of-the-art models:
- MiDaS (Small & Large variants) - Fast and reliable
- DPT (Large & Hybrid) - High accuracy
- ZoeDepth (K, N, NK, N-indoor) - Specialized for different scenarios
- Depth-Anything - Latest cutting-edge models
- Depth-to-3D Conversion - Direct conversion from depth maps
- Edge-based Mesh Creation - Generate meshes from detected edges
- Surface Partitioning - Intelligent surface segmentation
- Extrusion Projection - Complex 3D reconstructions from contours
- Real-time Preview - See your mesh as it's created
- 3D Text Generator - Create 3D text meshes using the included MeshTools
- Mesh Manipulation - Scale, rotate, and transform meshes
- Custom Coloring - Apply gradients and color transitions
- Measurement Grid - Visualize dimensions and proportions
- Batch Processing - Process multiple images efficiently
- Python 3.12 (
โ ๏ธ Not compatible with Python 3.13+) - Windows (primary support) or Linux/WSL
- 4GB+ RAM recommended
- NVIDIA GPU (optional, for faster processing)
# Clone the repository
git clone https://github.com/lelandg/EdgeMesh.git
cd EdgeMesh
# Run the automated installer
python install_requirements.py# Clone the repository
git clone https://github.com/lelandg/EdgeMesh.git
cd EdgeMesh
# Update pip
python -m pip install --upgrade pip
# Install requirements
pip install -r requirements.txt
# For Open3D compatibility issues
python install_open3d.pypython edge_mesh.py
# or simply:
run.batpython3 edge_mesh.pyClick "Load Image" and select any image file (PNG, JPG, etc.)
- Depth Model: Choose your preferred AI model
- Smoothing: Select smoothing method and intensity
- Edge Detection: Adjust thresholds for edge sensitivity
- Resolution: Set mesh resolution (higher = more detail)
Click "Generate 3D Mesh" to create your 3D model
- Use the 3D viewport to inspect your mesh
- Mouse controls: Rotate, zoom, pan
- Export as
.objor.stlfor 3D printing or further editing
- Enable "Dynamic Depth" for 3D printing-friendly meshes
- Use "Remove Background" for cleaner results
- Try different depth models for various image types
- Indoor scenes work best with ZoeDepth N-indoor model
EdgeMesh follows a modular pipeline architecture:
๐ท Image Input
โ
๐จ Preprocessing (Edge Detection, Smoothing)
โ
๐ง Depth Estimation (AI Models)
โ
๐จ Mesh Generation (Depth-to-3D or Edge-based)
โ
โจ 3D Viewport (Interactive Preview)
โ
๐พ Export (.obj, .stl)
For detailed architecture information, see the Code Map.
- Load a portrait photo
- Select MiDaS Large model
- Enable Dynamic Depth
- Generate and export for 3D printing
- Load building photograph
- Use DPT Hybrid for accuracy
- Enable edge detection for sharp details
- Export to modeling software
python MeshTools/text_3d.py --text "Hello 3D" --height 100 --depth 20Important: Open3D 0.19.0 is not compatible with Python 3.13+
Solutions:
-
Use Python 3.12:
# Check your version python --version # If 3.13+, install Python 3.12
-
Create a virtual environment:
python3.12 -m venv venv source venv/bin/activate # Linux/Mac venv\Scripts\activate # Windows
-
Run compatibility checker:
python install_open3d.py
Issue: ImportError with Open3D Solution: Reinstall with specific version
pip install open3d==0.19.0 --force-reinstall --no-cache-dirIssue: CUDA/GPU not detected Solution: Install PyTorch with CUDA support
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu118- ๐ Code Map - Complete project structure and navigation
- ๐ 3D Mesh Creation Flow - Detailed processing pipeline
- ๐ Version History - Release notes and changes
- ๐ ๏ธ API Reference - Detailed class and method documentation
We welcome contributions! Here's how you can help:
- ๐ด Fork the repository
- ๐ฟ Create a feature branch (
git checkout -b feature/AmazingFeature) - ๐ป Make your changes
- โ Test thoroughly
- ๐ Commit (
git commit -m 'Add AmazingFeature') - ๐ค Push (
git push origin feature/AmazingFeature) - ๐ฏ Open a Pull Request
# Clone with submodules
git clone --recursive https://github.com/lelandg/EdgeMesh.git
# Install in development mode
pip install -e .
# Run tests (when available)
python -m pytestFor AI-powered image generation that can serve as input for 3D mesh creation, check out ImageAI - a comprehensive tool supporting multiple AI providers including:
- Google Gemini
- OpenAI DALL-E
- Stability AI
- Local Stable Diffusion
Perfect for creating unique images to convert into 3D meshes! ๐
Leland Green
- ๐ Website: LelandGreen.com
- ๐ง Email: contact@lelandgreen.com
- ๐ฌ Discord: The Intersection of Art and AI
- ๐ GitHub: @lelandg
Also creator of ImageAI - Advanced AI Image & Video Generation Tool
This project is proprietary software. Please see the LICENSE file for details.
- Open3D Team - For the excellent 3D processing library
- PyTorch Team - For deep learning framework
- MiDaS Contributors - For depth estimation models
- Qt/PyQt6 - For the robust GUI framework
- Community Contributors - For feedback and improvements
- ๐ค More AI models (SAM integration)
- ๐ฑ Mobile companion app
- โก GPU acceleration optimizations
- ๐ง Plugin system for custom processors
- Real-time 3D reconstruction from webcam
- VR/AR export capabilities
- Cloud processing for large batches
- AI-assisted mesh refinement
If you find EdgeMesh useful, please:
- โญ Star the repository
- ๐ Report bugs via Issues
- ๐ก Suggest features
- ๐ฃ Share with others
- ๐ค Join our Discord Community
Made with โค๏ธ by Leland Green