Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Estimate metric depth from single RGB image
from grid_cortex_client import CortexClient, ModelType import numpy as np from PIL import Image client = CortexClient() image = np.array(Image.open("cat.jpg")) depth = client.run(ModelType.DA3METRIC, image_input=image) print(depth.shape) # (480, 640)
from grid_cortex_client import CortexClient from PIL import Image client = CortexClient() image = Image.open("scene.jpg") # 640x480 RGB depth = client.run(model_id="da3metric", image_input=image) print(depth.shape, depth.dtype) # (378, 504) float32 — note: output resolution differs from input print(f"min={depth.min():.4f}, max={depth.max():.4f}, mean={depth.mean():.4f}") # min=1.6177, max=53.1848, mean=12.9778 (meters)
Related topics
Was this page helpful?