Depth Pro MCP Server
Enables AI assistants to perform monocular depth estimation on images using Apple's Depth Pro model, with tools for single or batch processing and GPU management.
README
<div align="center">
🔬 Depth Pro Docker
Production-ready Docker deployment for Apple's Depth Pro model
Zero-shot monocular metric depth estimation • 2.25MP depth map in 0.3s

</div>
✨ Features
| Feature | Description |
|---|---|
| 🚀 One-Click Deploy | Docker Compose for instant deployment |
| 🎨 Modern Web UI | Beautiful interface with multiple colormaps |
| 🔌 REST API | Full-featured API with Swagger docs |
| 🤖 MCP Server | Model Context Protocol support for AI assistants |
| 📊 Multiple Outputs | JPG visualization, NPZ data, 16-bit PNG |
| 🎛️ Manual Focal Length | Override auto focal length estimation |
| 🌐 Multi-language | Chinese, English, Japanese UI |
| 💾 GPU Management | Auto memory offload, status monitoring |
🚀 Quick Start
# One command to run (All-in-One image, no downloads needed!)
docker run -d --name depth-pro --gpus all -p 8500:8500 neosun/depth-pro:latest
# Open browser
open http://localhost:8500
📦 Installation
Prerequisites
- Docker 24.0+ with NVIDIA Container Toolkit
- NVIDIA GPU with 8GB+ VRAM (16GB+ recommended)
- CUDA 12.1 compatible driver
Method 1: Docker Run (Recommended)
All-in-One image includes model weights (~5GB), no additional downloads required!
# Pull and run (model included in image)
docker run -d \
--name depth-pro \
--gpus all \
-p 8500:8500 \
-e GPU_IDLE_TIMEOUT=60 \
neosun/depth-pro:latest
Method 2: Docker Compose
# Create docker-compose.yml
cat > docker-compose.yml << 'EOF'
services:
depth-pro:
image: neosun/depth-pro:latest
container_name: depth-pro
ports:
- "8500:8500"
environment:
- GPU_IDLE_TIMEOUT=60
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
restart: unless-stopped
EOF
# Start service
docker compose up -d
Method 3: Local Development
# Create conda environment
conda create -n depth-pro python=3.9 -y
conda activate depth-pro
# Install dependencies
pip install -e .
pip install flask flask-cors flasgger gunicorn
# Download model
source get_pretrained_models.sh
# Run server
python app.py
⚙️ Configuration
Environment Variables
| Variable | Default | Description |
|---|---|---|
PORT |
8500 |
Server port |
GPU_IDLE_TIMEOUT |
60 |
Seconds before GPU memory release |
NVIDIA_VISIBLE_DEVICES |
0 |
GPU device index |
docker-compose.yml
services:
depth-pro:
image: neosun/depth-pro:latest
container_name: depth-pro
ports:
- "8500:8500"
environment:
- PORT=8500
- GPU_IDLE_TIMEOUT=60
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8500/health"]
interval: 30s
timeout: 10s
retries: 3
📖 Usage
Web Interface
Visit http://localhost:8500 for the interactive UI:
- Upload an image (JPG/PNG/WebP/HEIC)
- Select colormap (Turbo, Viridis, Plasma, etc.)
- Optionally set manual focal length
- Click "Process" and download results
REST API
Depth Estimation
curl -X POST http://localhost:8500/api/predict \
-F "file=@image.jpg" \
-F "colormap=turbo" \
-F "focal_length=1000"
Response:
{
"task_id": "abc12345",
"focal_length_px": 1000.0,
"min_depth_m": 0.5,
"max_depth_m": 10.2,
"mean_depth_m": 3.4,
"image_size": "1920x1080",
"depth_image_base64": "...",
"download_jpg": "/api/download/abc12345/color.jpg",
"download_npz": "/api/download/abc12345/depth.npz",
"download_16bit": "/api/download/abc12345/depth16.png"
}
GPU Status
curl http://localhost:8500/api/gpu/status
Release GPU Memory
curl -X POST http://localhost:8500/api/gpu/offload
API Documentation
Swagger UI available at: http://localhost:8500/apidocs/
MCP Server (for AI Assistants)
Add to your Claude Desktop config:
{
"mcpServers": {
"depth-pro": {
"command": "docker",
"args": ["exec", "-i", "depth-pro", "python3", "mcp_server.py"]
}
}
}
Available MCP tools:
estimate_depth- Process single imagebatch_estimate_depth- Process multiple imagesget_gpu_status- Check GPU statusrelease_gpu- Free GPU memory
📁 Project Structure
depth-pro-docker/
├── app.py # Flask web server
├── mcp_server.py # MCP server for AI assistants
├── gpu_manager.py # GPU memory management
├── Dockerfile # Container build file
├── docker-compose.yml # Docker Compose config
├── checkpoints/ # Model weights (download separately)
│ └── depth_pro.pt
├── src/depth_pro/ # Core model code
├── templates/ # HTML templates
├── static/ # CSS/JS assets
└── docs/ # Documentation
🛠️ Tech Stack
- Model: Apple Depth Pro (DINOv2 + Multi-scale ViT)
- Backend: Flask + Gunicorn
- Frontend: Vanilla JS + Modern CSS
- Container: Docker + NVIDIA Container Toolkit
- GPU: PyTorch + CUDA 12.1
📝 Limitations
- Far-field scenes (>20m) may have inaccurate absolute depth values
- Best suited for indoor and close-range outdoor scenes
- Relative depth ordering is generally reliable even for far scenes
🤝 Contributing
Contributions are welcome! Please read CONTRIBUTING.md first.
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing) - Open a Pull Request
📄 License
This project is based on Apple's Depth Pro and is licensed under the Apple Sample Code License.
🙏 Acknowledgements
- Apple ML Research - Original Depth Pro model
- Depth Pro Paper - Research paper
⭐ Star History
📱 Follow Me
<div align="center">

</div>
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。