Apache License 2.0

技术解读

以下内容由 GitRead 中文社区 编辑团队基于项目 README 与官方资料整理, 结合中文开发者的常见使用场景补充技术选型建议。具体以项目官方文档为准。

项目背景与痛点

项目 “Robbyant/lingbot-depth” 主要聚焦于基于 Masked Depth Modeling 的空间感知问题,是对现有深度感知技术的一次有意义的探索和优化。空间感知在机器人导航、自动驾驶、增强现实等领域扮演着关键角色,准确定位和理解三维空间环境是实现这些应用场景的基础。该项目通过引入 Masked Depth Modeling,成功提升了对图像中不同区域的深度感知能力,特别是在复杂场景下的表现更为出色。

核心技术揭秘

技术架构

项目采用了深度学习方法来解决 Masked Depth Modeling 的问题。其背后的设计思路是通过对输入图像进行特定掩膜处理,之后使用深度学习模型来预测掩膜区域的深度信息。这种方法不仅可以高效处理图像中的多个目标,还能提升算法对不同光照和背景条件的适应性。

graph TD A[输入图像] A --> B[预处理阶段] B --> C[掩膜生成] B --> E{"多目标处理?"} E -->|"是"| F[多掩膜处理] E -->|"否"| G[单掩膜处理] F --> H[深度估计] G --> H H --> I[后处理] I --> J[输出深度图]

通过上述流程,项目优化了深度估计的精度。深度估计模块采用了基于卷积网络的架构,能够对图像的局部特征和全局结构作出较好的建模。

实现细节

为了确保模型具备高效的推理能力和良好的泛化能力,项目团队在数据增强、模型训练以及优化策略上均进行了细致的调试。具体的算法和模型的选择基于它的效率和性能,充分考虑到了现有计算资源的限制。

功能亮点与差异

相较于同类产品和技术,本项目最大的优势在于其对复杂环境的支持能力和更高的精度。尤其是对于有遮挡或光照复杂的情况,项目能够更精确地预测目标的深度信息。同时,其灵活的数据流和多掩膜处理方法,为用户提供了较强的自定义和优化空间。

应用场景与落地建议

该技术特别适合需要高精度深度感知的场景,如机器人自动化导航、自动驾驶中的障碍物识别、增强现实中的物体追踪等。建议在落地过程中注意模型的实时性能和电池续航能力的限制。针对具体的业务需求,合理选择模型的大小和复杂度,有助于平衡精度与效率。

综合评价

该项目在空间感知技术上迈出了至关重要的一步,通过 Masked Depth Modeling 技术有效地提升了算法在复杂环境下的鲁棒性和精度。尽管如此,其在实际应用中仍需要关注计算效率和模型大小的问题,以及如何更好地结合现实场景的实际需求和限制,持续追求更高的性能和用户体验。

关于

GitHub 原始描述(英文)

Masked Depth Modeling for Spatial Perception

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

简要分析

热度分
1966
价值分
1055
活跃状态
活跃

语言占比

Python

README

LingBot-Depth: Masked Depth Modeling for Spatial Perception

License Python 3.9+ PyTorch 2.6+

📄 Technical Report | 📄 arXiv | 🌐 Project Page | 💻 Code | 🤗 Data | 🤗 Hugging Face | 🤖 ModelScope | 🤖 Video

LingBot-Depth transforms incomplete and noisy depth sensor data into high-quality, metric-accurate 3D measurements. By jointly aligning RGB appearance and depth geometry in a unified latent space, our model serves as a powerful spatial perception foundation for robot learning and 3D vision applications.

Our approach refines raw sensor depth into clean, complete measurements, enabling:

  • Depth Completion & Refinement: Fills missing regions with metric accuracy and improved quality
  • Scene Reconstruction: High-fidelity indoor mapping with a strong depth prior
  • 4D Point Tracking: Accurate dynamic tracking in metric space for robot learning
  • Dexterous Manipulation: Robust grasping with precise geometric understanding

News

  • [2026.06.18] Our paper has been accepted to ECCV 2026.
  • [2026.03.31] Our dataset for masked depth modeling is now public.
  • [2026.02.15] Upload LingBot-Depth-v0.5 which fixes the bug in previous version.

Artifacts Release

Model Zoo

We provide pretrained models for different scenarios:

Model Hugging Face Model ModelScope Model Description
LingBot-Depth-v0.5 robbyant/lingbot-depth-pretrain-vitl-14-v0.5 robbyant/lingbot-depth-pretrain-vitl-14-v0.5 ⭐ Recommended! General-purpose depth refinement and completion for both dense and sparse raw depth(fixes the bug in LingBot-Depth-v0.1)
LingBot-Depth-v0.1 robbyant/lingbot-depth-pretrain-vitl-14 robbyant/lingbot-depth-pretrain-vitl-14 General-purpose depth refinement
LingBot-Depth-DC robbyant/lingbot-depth-postrain-dc-vitl14 robbyant/lingbot-depth-postrain-dc-vitl14 Optimized for sparse depth completion

Data Release

Name Description Samples
RobbyReal Real-world indoor scenes captured with multiple RGB-D cameras 1,400,000
RobbyVla Real-world data collected during VLA (Vision-Language-Action) robot manipulation tasks 580,960
RobbySim Simulated data rendered from two camera viewpoints 999,264
RobbySimVal Validation split of simulated data 38,976
Total 3,019,200

Installation

Requirements

• Python ≥ 3.9 • PyTorch ≥ 2.0.0 • CUDA-capable GPU (recommended)

From source

git clone https://github.com/robbyant/lingbot-depth
cd lingbot-depth

# Install the package (use 'python -m pip' to ensure correct environment)
conda create -n lingbot-depth python=3.9
conda activate lingbot-depth
python -m pip install -e .

Quick Start

Inference:

import torch
import cv2
import numpy as np
from mdm.model.v2 import MDMModel

# Load model
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model = MDMModel.from_pretrained('robbyant/lingbot-depth-pretrain-vitl-14-v0.5').to(device)

# Load and prepare inputs
image = cv2.cvtColor(cv2.imread('examples/0/rgb.png'), cv2.COLOR_BGR2RGB)
h, w = image.shape[:2]
image = torch.tensor(image / 255, dtype=torch.float32, device=device).permute(2, 0, 1)[None]

depth = cv2.imread('examples/0/raw_depth.png', cv2.IMREAD_UNCHANGED).astype(np.float32) / 1000.0
depth = torch.tensor(depth, dtype=torch.float32, device=device)[None]

intrinsics = np.loadtxt('examples/0/intrinsics.txt')
intrinsics[0] /= w  # Normalize fx and cx by width
intrinsics[1] /= h  # Normalize fy and cy by height
intrinsics = torch.tensor(intrinsics, dtype=torch.float32, device=device)[None]

# Run inference
output = model.infer(
    image,
    depth_in=depth,
    intrinsics=intrinsics)

depth_pred = output['depth']  # Refined depth map
points = output['points']      # 3D point cloud

Run example:

The model is automatically downloaded from Hugging Face on first run (no manual download needed):

# Basic usage - processes example 0
python example.py

# Use a different example (0-7 available)
python example.py --example 1

# Use depth completion optimized model
python example.py --model robbyant/lingbot-depth-postrain-dc-vitl14-v0.5

# Custom output directory
python example.py --output my_results

# See all options
python example.py --help

This processes the example data and saves results to result/ (or custom directory):

result/
├── rgb.png                 # Input RGB image
├── depth_input.npy        # Input depth (float32, meters)
├── depth_refined.npy      # Refined depth (float32, meters)
├── depth_input.png        # Input depth visualization
├── depth_refined.png      # Refined depth visualization
├── depth_comparison.png   # Side-by-side comparison
└── point_cloud.ply       # 3D point cloud

Available examples: 8 example scenes (0-7) included in examples/ directory.

Method

We introduce a masked depth modeling approach that learns robust RGB-D representations through self-supervised learning. The model employs a Vision Transformer encoder with specialized depth-aware attention mechanisms to jointly process RGB and depth inputs.

Depth-aware attention visualization. Visualizing attention from depth queries (Q1–Q3, marked with ⋆) to RGB tokens in two scenes: (a) aquarium and (b) indoor shelf. Each row shows masked input depth, attention weights on RGB, and refined output. Different queries attend to spatially corresponding regions, demonstrating cross-modal alignment.

Key Innovations:

  • Masked Depth Modeling: Self-supervised pre-training via depth reconstruction
  • Cross-Modal Attention: Joint RGB-Depth alignment in unified latent space
  • Metric-Scale Preservation: Maintains real-world measurements for downstream tasks

Training Data

Our model is trained on a large-scale diverse dataset combining real-world and simulated RGB-D captures:

Training dataset. 2M real-world and 1M simulated samples spanning diverse indoor environments (top). Representative RGB-D inputs with ground truth depth (bottom).

Dataset Composition:

  • Real Captures: 2M samples from residential, office, and commercial environments
  • Simulated Data: 1M photo-realistic renders with perfect ground truth
  • Modalities: RGB images, raw depth, refined ground truth depth
  • Diversity: Multiple sensor types, lighting conditions, and scene complexities

Applications

4D Point Tracking

LingBot-Depth provides metric-accurate 3D geometry essential for tracking dynamic targets:

4D point tracking. Robust tracking in gym environments with dynamic human motion. Top: query point selection. Middle: 3D tracking on deforming geometry. Bottom: refined depth maps. Demonstrated on scooter, rowing machine, gym equipment, and pull-up bar.

Dexterous Manipulation

High-quality geometric understanding enables reliable robotic grasping across diverse objects and materials:

Dexterous grasping. Robust manipulation enabled by refined depth. Top: point cloud reconstruction. Bottom: successful grasps on steel cup, glass cup, storage box, and toy car.

Hardware Setup

We developed a scalable RGB-D capture system for large-scale data collection:

RGB-D capture system. Multi-sensor setup with Intel RealSense, Orbbec Gemini, and Azure Kinect for scalable real-world data collection.

Model Details

Architecture

  • Encoder: Vision Transformer (Large) with RGB-D fusion
  • Decoder: Multi-scale feature pyramid with specialized heads
  • Heads: Depth regression
  • Training: Masked depth modeling with reconstruction objective

Input Format

RGB Image:

  • Shape: [B, 3, H, W] normalized to [0, 1]
  • Format: PyTorch tensor, float32

Depth Map:

  • Shape: [B, H, W]
  • Unit: Meters (configurable via scale parameter)
  • Invalid regions: 0 or NaN

Camera Intrinsics:

  • Shape: [B, 3, 3]
  • Normalized format: fx'=fx/W, fy'=fy/H, cx'=cx/W, cy'=cy/H
  • Example:
    [[fx/W,   0,   cx/W],
     [  0,  fy/H,  cy/H],
     [  0,    0,    1  ]]
    

Output Format

The model returns a dictionary:

{
    'depth': torch.Tensor,   # Refined depth [B, H, W]
    'points': torch.Tensor,  # Point cloud [B, H, W, 3] in camera space
}

Inference Parameters

model.infer(
    image,                                   # RGB tensor [B, 3, H, W]
    depth_in=None,                           # Input depth [B, H, W]
    use_fp16=True,                           # Mixed precision inference
    intrinsics=None,                         # Camera intrinsics [B, 3, 3]
)

Citation

If you find this work useful for your research, please cite:

@article{lingbot-depth2026,
  title={Masked Depth Modeling for Spatial Perception},
  author={Tan, Bin and Sun, Changjiang and Qin, Xiage and Adai, Hanat and Fu, Zelin and Zhou, Tianxiang and Zhang, Han and Xu, Yinghao and Zhu, Xing and Shen, Yujun and Xue, Nan},
  journal={arXiv preprint arXiv:2601.17895},
  year={2026}
}

Please also consider citing DINOv2, which serves as our backbone:

@article{oquab2023dinov2,
  title={DINOv2: Learning Robust Visual Features without Supervision},
  author={Oquab, Maxime and Darcet, Timothée and Moutakanni, Theo and Vo, Huy and Szafraniec, Marc and Khalidov, Vasil and Fernandez, Pierre and Haziza, Daniel and Massa, Francisco and El-Nouby, Alaaeldin and others},
  journal={Transactions on Machine Learning Research},
  year={2024}
}

License

This project is released under the Apache License 2.0. See LICENSE file for details.

Acknowledgments

This work builds upon several excellent open-source projects:

  • DINOv2 - Self-supervised vision transformer backbone
  • Masked Autoencoders - Self-supervised learning framework
  • The broader open-source computer vision and robotics communities

Contact

For questions, discussions, or collaborations:

评论

暂无评论