whatisgithub

What is ml-depth-pro?

apple/ml-depth-pro — explained in plain English

Analysis updated 2026-06-26

5,507PythonAudience · researcherComplexity · 4/5Setup · hard

In one sentence

An Apple research model that takes a single photo and estimates the real-world distance of every pixel in meters, producing a 2.25-megapixel depth map in about 0.3 seconds on a GPU.

Mindmap

mindmap
  root((repo))
    What it does
      Single-image depth
      Per-pixel distances
      Focal length estimate
    Tech Stack
      Python
      PyTorch
      GPU required
    Use Cases
      AR foreground mask
      3D reconstruction
      Scene geometry
    Setup
      Virtual environment
      Download weights
      CLI or Python API
    Outputs
      Depth map PNG
      Meters per pixel
      Focal length
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Separate foreground from background in photos for image editing without needing special depth camera hardware

USE CASE 2

Feed depth maps from single photos into a 3D reconstruction or augmented reality pipeline

USE CASE 3

Estimate scene geometry from any photo for robotics or autonomous driving research

What is it built with?

PythonPyTorchCUDA

How does it compare?

apple/ml-depth-promiguelgrinberg/flask-socketiopennyw0rth/netexec
Stars5,5075,5095,511
LanguagePythonPythonPython
Setup difficultyhardeasymoderate
Complexity4/52/54/5
Audienceresearcherdeveloperops devops

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · hard Time to first run · 1h+

Requires a GPU, Python virtual environment setup, and downloading pretrained model weights via a provided script before first use.

So what is it?

Depth Pro is a research project from Apple that takes a single photograph and estimates how far away each part of the scene is, producing what researchers call a depth map. Unlike older tools that need camera settings or paired images to figure out distances, this one works from a single image with no extra information required. It produces a 2.25-megapixel depth map in about 0.3 seconds on a typical graphics card. The key practical output is a per-pixel distance estimate measured in real units (meters), not just relative guesses. It also estimates the focal length of the camera that took the photo, which helps calibrate the depth reading. The model is described in a research paper published through Apple, and the code here is a re-trained reference version whose quality is close to, but not identical to, the paper results. To use it, you install the Python package in a virtual environment, download the pretrained model weights via a provided script, and then either run a command-line tool on an image file or call it directly from Python code. The Python interface loads the model, feeds it an image, and returns depth values and focal length. There are also evaluation tools included for measuring how accurately the model traces edges and boundaries in depth maps. The repository is likely useful to developers building apps that need to understand scene geometry from photos, such as augmented reality tools, 3D reconstruction pipelines, or image editing software that needs to separate foreground from background. It is a research release rather than a production SDK, so expect to do some setup work before it fits into an existing project.

Copy-paste prompts

Prompt 1
I want to use Apple Depth Pro to generate a depth map from a JPEG photo in Python. Show me the complete code to load the model, run inference on an image, and save the depth output as a 16-bit PNG.
Prompt 2
How do I batch-process a folder of images with Depth Pro and save each result as a numpy array for use in a downstream 3D pipeline?
Prompt 3
I am building a photo editing app that needs to blur the background behind a subject. Show me how to use Depth Pro output to create a binary foreground mask by thresholding the depth values.
Prompt 4
How do I evaluate Depth Pro's edge accuracy on my own dataset using the included evaluation tools?

Frequently asked questions

What is ml-depth-pro?

An Apple research model that takes a single photo and estimates the real-world distance of every pixel in meters, producing a 2.25-megapixel depth map in about 0.3 seconds on a GPU.

What language is ml-depth-pro written in?

Mainly Python. The stack also includes Python, PyTorch, CUDA.

How hard is ml-depth-pro to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is ml-depth-pro for?

Mainly researcher.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.