Skip to main content
Estimate depth from a single RGB image using ZoeDepth. Returns metric depth values in meters.

Parameters

image_input
str | PIL.Image | np.ndarray
required
RGB image as file path, URL, PIL Image, or numpy array.
timeout
float | None
Optional timeout in seconds for the HTTP request.

Returns

np.ndarray — Depth map of shape (H, W) with dtype float16 (the client converts to float32 on read). Values represent metric depth in meters.

Example Output

ZoeDepth input and depth map output

Example

from grid_cortex_client import CortexClient
from PIL import Image

client = CortexClient()
image = Image.open("scene.jpg")  # 640x480 RGB
depth = client.run(model_id="zoedepth", image_input=image)

print(depth.shape, depth.dtype)
# (480, 640) float32

print(f"min={depth.min():.4f}, max={depth.max():.4f}, mean={depth.mean():.4f}")
# min=1.5889, max=10.2891, mean=4.6381  (meters)