github ultralytics/ultralytics v8.4.104
v8.4.104 - New YOLO26-Depth monocular depth estimation task (#25065)

4 hours ago

๐ŸŒŸ Summary

YOLO26 gains a complete monocular depth estimation task, enabling per-pixel distance prediction, training, validation, visualization, calibration, and deployment alongside existing Ultralytics tasks. ๐ŸŒ๐Ÿ“

๐Ÿ“Š Key Changes

  • New YOLO26-Depth model family ๐Ÿค–

    • Adds yolo26n-depth, yolo26s-depth, yolo26m-depth, yolo26l-depth, and yolo26x-depth.
    • Uses a DPT-style depth head that fuses multi-scale YOLO26 features to produce dense depth maps aligned with the input image.
    • Supports both unbounded log-depth output for short- and long-range scenes and bounded depth output modes.
  • Depth is now a first-class Ultralytics task ๐Ÿ†•

    • Available through the CLI:
      yolo depth train
      yolo depth val
      yolo depth predict
      yolo export
    • Fully supported through the Python Model API, including prediction, training, validation, export, and model.calibrate().
  • Improved depth training and evaluation ๐Ÿ“Š

    • Adds depth-specific loss functions combining scale-aware depth accuracy with multi-scale edge and gradient matching.
    • Adds standard depth metrics such as delta1, delta2, delta3, absolute relative error, RMSE, and SILog.
    • Handles sparse or invalid ground-truth pixels safely.
  • Depth-aware data pipeline ๐Ÿ—‚๏ธ

    • Introduces paired RGB image and .npy float32 depth-map loading.
    • Applies geometric transformations and flips consistently to images and depth maps.
    • Adds validation for missing, corrupt, incorrectly shaped, or unreadable depth targets.
    • Adds Depth8, an 8-image dataset for rapid pipeline testing and debugging.
  • Large dataset and benchmark support ๐ŸŒ

    • Adds configurations and documentation for NYU Depth V2, KITTI, SUN RGB-D, ARKitScenes, DIODE, Hypersim, TartanAir, Virtual KITTI 2, and others.
    • Documents zero-shot evaluation on NYU Depth V2, KITTI, ETH3D, Make3D, and iBims-1.
    • Released models are pretrained on a broad mix of approximately 2.19 million indoor, outdoor, synthetic, real-world, and pseudo-labeled images.
  • Depth visualization and results support ๐ŸŽจ

    • Adds DepthMap results, depth heatmap plotting, depth-aware result summaries, and access through result.depth.data.
    • Depth predictions can be converted through the existing .cpu() and .numpy() workflows.
  • Export and deployment support ๐Ÿš€

    • Adds depth export support for formats such as ONNX and TensorRT.
    • Dynamic exported output shapes track the input image dimensions.
    • TensorRT documentation now correctly lists the supported opset and workspace arguments.
    • Explicitly prevents unsupported NMS or IMX export configurations for depth models.
  • More reliable training logs ๐Ÿงพ

    • Loss components are now returned as name-keyed dictionaries rather than positional tensors.
    • Fixes incorrect logging of l1_loss as dfl_loss when DFL is not used.
    • Makes loss reporting more robust across detection, segmentation, pose, distillation, classification, and depth tasks.
  • Performance and reliability improvements โšก

    • Computes DFL log_softmax once instead of twice, improving the DFL loss path by approximately 1.5โ€“1.75ร— in benchmarks.
    • Reduces TaskAlignedAssigner kernel launches by batching candidate accumulation.
    • Caches semantic-mask bit depth to avoid reopening mask files every epoch.
    • Makes plotting threads non-daemon so generated plots finish writing before interpreter shutdown.
  • Export, dataset, and workflow fixes ๐Ÿ› ๏ธ

    • Converts Path export arguments to strings, preventing exported ONNX metadata from failing to reload.
    • Fixes tar archive cleanup when using safe_download(..., delete=True).
    • Adds depth-target support to NDJSON dataset conversion.
    • Improves macOS CI stability and queues PyPI publishing with retry handling.
    • Adds documented pretrained YOLO26 detection and segmentation checkpoints for Objects365.

๐ŸŽฏ Purpose & Impact

  • Expands YOLO26 beyond object recognition ๐ŸŒŸ
    Users can now infer scene geometry and approximate camera-to-surface distances from a single RGB image, supporting robotics, navigation, AR/VR, 3D reconstruction, and spatial awareness applications.

  • Handles a wider range of environments ๐Ÿ ๐Ÿš—
    The unbounded log-depth design avoids a fixed short-range ceiling, making the models better suited to both indoor scenes and long-range outdoor driving data such as KITTI.

  • Simplifies end-to-end development โœ…
    Depth estimation uses the same familiar Ultralytics workflow for dataset preparation, training, validation, prediction, export, and Python integration.

  • Improves custom-dataset adaptation ๐ŸŽฏ
    Users can fine-tune pretrained YOLO26-Depth models and calibrate absolute depth scale without retraining the network, helping adapt predictions to a particular camera or environment.

  • Makes deployments more dependable ๐Ÿ”’
    Dynamic export shapes, corrected metadata serialization, more accurate TensorRT documentation, and safer archive handling reduce friction when moving models into production.

  • Benefits existing tasks as well โš™๏ธ
    The loss-dictionary refactor, DFL optimization, assigner optimization, semantic-mask caching, and CI robustness fixes improve maintainability, logging accuracy, training speed, and reliability across the broader Ultralytics framework.

For production workflows, YOLO26 remains the recommended latest stable model family. Users who prefer managed annotation, training, and deployment can also use the Ultralytics Platform.

What's Changed

Full Changelog: v8.4.103...v8.4.104

Don't miss a new ultralytics release

NewReleases is sending notifications on new releases.