depth-estimation Β· vision Β· WebGPU (q4f16) Β· ~572 MB
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.
| Model | onnx-community/DepthPro-ONNX (ONNX of Apple apple/DepthPro) |
|---|---|
| Task / pipeline | depth-estimation β monocular, metric-scale (model_type depth_pro) |
| Architecture | Multi-scale ViT (patch + image encoders) fused into a high-resolution depth head β sharp, absolute-scale depth at native 1536Β² |
| Quantization | q4f16 (4-bit weights, fp16 compute) ONNX |
| Backend | WebGPU 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 |
| License | apple-ascl (Apple Sample Code License, on the onnx-community ONNX repo) |
| Web APIs | WebGPU (required), Web Workers, Canvas 2D, FileReader β the page shows an honest needs-WebGPU state where WebGPU is missing |
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.
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.
| predicted_depth shape | β |
|---|---|
| raw depth range (metric-scale) | β |
| mean raw depth | β |
| boundary sharpness (edge fraction) | β |
| pixels estimated | β |
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.
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:
One photo in, a sharp colourised depth map out β read distance as colour.
Tap two points and read their relative distance from the metric-scale depth field.
3D parallax β tilt a flat photo with your pointer and feel DepthPro's crisp depth.
DepthPro depth + Segformer segmentation β the mean distance of each labelled region.
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.