Player not loading? Watch on YouTube
This tutorial introduces monocular depth estimation with Ultralytics YOLO26: estimating the distance of each pixel from the camera using one image. The speaker distinguishes relative depth, which describes which objects are closer, from metric depth, which estimates distances in meters.
The Python walkthrough starts with installing the Ultralytics package and loading a pretrained YOLO26 small depth model. It retrieves a tensor through result.depth.data, converts it to a NumPy array, queries a distance at pixel coordinates, and saves the raw array as an .npy file for later use.
The colorize_depth example uses inferno, jet, or spectral color maps. Disparity visualization makes nearby objects brighter, while metric visualization makes more distant areas brighter. The speaker warns that colors should not serve as distance measurements; calculations should use the original depth array.
For a camera setup with distance estimates that are consistently off, the tutorial demonstrates calibration with annotated data. Matching images and depth arrays must have the same names and dimensions. The speaker describes calibration as an adjustment to the model's depth head without training epochs, and recommends full retraining when the model fails to capture scene geometry. The closing discussion covers model sizes and export formats, including ONNX and Core ML. Speed, the speaker says, depends on resolution, hardware, and export format.