← All models

depth-estimation Β· vision Β· WebGPU (q4f16) Β· ~572 MB

DepthPro β€” sharp, metric-scale depth from one photo

DepthPro is Apple's high-resolution monocular depth model. Give it one photo and it estimates the distance to every pixel β€” but unlike a smooth relative map, DepthPro is trained for metric-scale depth with razor-sharp boundaries: crisp object edges and a consistently-scaled depth field. It's a large model that runs on WebGPU; the photo never leaves the tab.

At a glance

Modelonnx-community/DepthPro-ONNX (ONNX of Apple apple/DepthPro)
Task / pipelinedepth-estimation β€” monocular, metric-scale (model_type depth_pro)
ArchitectureMulti-scale ViT (patch + image encoders) fused into a high-resolution depth head β†’ sharp, absolute-scale depth at native 1536Β²
Quantizationq4f16 (4-bit weights, fp16 compute) ONNX
BackendWebGPU required β€” a large fp16 model; there is no practical WASM/CPU path in a browser
Download~572 MB, cached after first load β€” only downloaded on a WebGPU device
Licenseapple-ascl (Apple Sample Code License, on the onnx-community ONNX repo)
Web APIsWebGPU (required), Web Workers, Canvas 2D, FileReader β€” the page shows an honest needs-WebGPU state where WebGPU is missing

Run it

Pick or drop a photo, then estimate depth. Warmer / brighter means closer; darker means further away. DepthPro keeps boundaries crisp, so edges between near and far stay sharp. Needs a WebGPU device β€” the panel below says so if yours can't run it.

Drop a photo, or click to choose
Two cats on a couch A sunlit bedroom A riverside at golden hour

Input

Selected photo

Estimated depth (sharp, metric-scale)

farnear

See inside

DepthPro outputs a tensor of real numbers, one per pixel β€” the raw metric-scale depth field. Two things make it different from a relative depth model: the values carry a consistent absolute scale (not arbitrary units re-normalized per image), and the boundaries are sharp. Below is the honest view: the raw range straight from the model, the depth distribution, and a measured boundary-sharpness score β€” the fraction of pixels sitting on a real depth discontinuity, computed from this run.

Estimate a depth map to see the raw numbers.

DepthPro vs relative depth (Depth Anything)

Depth Anything is small, fast, WASM-friendly, and gives a relative depth map β€” great for parallax and blur, but the range is arbitrary and re-normalized per image, and fine boundaries soften. DepthPro trades size and a WebGPU requirement for metric scale (consistent absolute depth) and sharp boundaries β€” the right tool when you need real distances or a clean cut at object edges. Same one-photo input; different guarantees.

Why it matters

Metric, boundary-accurate depth from a single frame β€” no stereo rig, no LiDAR β€” opens up effects and measurements that a relative map can't support:

Use cases

Basics

One photo in, a sharp colourised depth map out β€” read distance as colour.

Practical

Tap two points and read their relative distance from the metric-scale depth field.

Wild

3D parallax β€” tilt a flat photo with your pointer and feel DepthPro's crisp depth.

Multi-model

DepthPro depth + Segformer segmentation β†’ the mean distance of each labelled region.

How the API works

Depth is a one-liner with Transformers.js. The pipeline returns both a ready-to-display image and the raw tensor:

import { pipeline } from "@huggingface/transformers";

const estimator = await pipeline(
  "depth-estimation",
  "onnx-community/DepthPro-ONNX",
  { device: "webgpu", dtype: "q4f16" },   // ~572 MB, WebGPU; cached after first load
);

const { depth, predicted_depth } = await estimator(imageURL);
// depth          β†’ RawImage: grayscale, min–max normalized to 0–255 (great for display)
// predicted_depth β†’ Tensor:  the raw per-pixel metric-scale depth (dims = [H, W])

This page colourises depth on a canvas and reads predicted_depth for the real range + distribution, and measures boundary sharpness from the depth map, in "See inside". Inference runs in a Web Worker so estimating a large photo never freezes the page. DepthPro is a WebGPU-class model; the loader shows an honest needs-WebGPU state on devices without a GPU adapter rather than downloading ~572 MB or faking a result.

References