Instructions to use ntoan199/DepthPro-mlx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use ntoan199/DepthPro-mlx with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] hf download ntoan199/DepthPro-mlx --local-dir DepthPro-mlx
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
Depth Pro โ MLX
Apple Depth Pro (sharp monocular metric depth from a single image) converted to MLX for Apple Silicon.
Code, CLI and 3D photo pipeline: github.com/ntoantoan/depthpro-mlx
Usage
pip install "depthpro-mlx[inpaint]"
depthpro-mlx photo.jpg --ply # depth.png, pointcloud.ply, 3d.mp4
import numpy as np
from PIL import Image
from depthpro_mlx import load_model, predict
model = load_model() # downloads these weights
image = np.array(Image.open("photo.jpg").convert("RGB"))
out = predict(model, image) # f_px=... if you know the focal length
out["depth"] # (H, W) depth in meters
out["focallength_px"] # estimated focal length
Files
| File | Description |
|---|---|
depth_pro.safetensors |
All 952M parameters in float16, NHWC conv layout |
Accuracy and speed
Parity against the official PyTorch implementation on the reference image (3024ร2268):
| Time (M4 Pro) | Peak memory | AbsRel vs. PyTorch fp32 | |
|---|---|---|---|
| PyTorch MPS fp16 | 3.76 s | 7.0 GB | โ |
| MLX fp16 | 3.06 s | 7.5 GB | 6.2e-4 |
| MLX fp32 | 4.17 s | 15.0 GB | 1.7e-6 |
License
These weights are a format conversion of Apple's released Depth Pro weights and are redistributed under Apple's original license terms (see LICENSE). That license is not OSI-approved: Apple grants a personal, non-exclusive license to use, modify and redistribute, and does not explicitly address commercial use, so check the terms before shipping the weights in a product. This conversion is not affiliated with or endorsed by Apple.
@inproceedings{Bochkovskii2024:arxiv,
author = {Aleksei Bochkovskii and Ama\"{e}l Delaunoy and Hugo Germain and Marcel Santos and
Yichao Zhou and Stephan R. Richter and Vladlen Koltun},
title = {Depth Pro: Sharp Monocular Metric Depth in Less Than a Second},
booktitle = {International Conference on Learning Representations},
year = {2025},
url = {https://arxiv.org/abs/2410.02073},
}
Hardware compatibility
Log In to add your hardware
Quantized
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐ Ask for provider support
Model tree for ntoan199/DepthPro-mlx
Base model
apple/DepthProSpace using ntoan199/DepthPro-mlx 1
Paper for ntoan199/DepthPro-mlx
Paper โข 2410.02073 โข Published โข 43