Skip to main content
Estimate metric depth and/or surface normals from a single RGB image.

Parameters

ImageInput
required
RGB image as file path, URL, PIL Image, or numpy array.
float | None
Optional timeout in seconds for the HTTP request.
Optional[Union[str, Sequence[str]]]
Keyword-only. Optional selection of maps to return — "depth", "normals", or a non-empty subset of both. None (default) returns both. Requesting only what you need shrinks the response payload (normals are 3x the size of depth).

Returns

Dict with the requested subset of:
  • "depth": (H, W) float32 array, metric depth in metres.
  • "normals": (H, W, 3) float32 array, unit surface normals.

Example

Uses Metric3D ViT-Large.

Example Output

Depth

Metric3D input and depth map output The depth map contains per-pixel metric distance in meters. Brighter regions (yellow/white) are farther from the camera; darker regions (purple/black) are closer. Values are absolute metric depth — larger values mean greater distance, and you can directly compare values across different images.

Surface Normals

Metric3D input and surface normals output Surface normals represent the direction each surface faces as a unit vector (x, y, z). In the RGB visualization, each channel maps to an axis: red = +x (right), green = +y (down), blue = +z (away from camera). Flat surfaces appear as uniform color; edges and curves show color transitions. Normals are mapped to RGB as (normal + 1) / 2 * 255 for display.

Working with the outputs

Related topics

metric3d