Zero-shot Depth Completion via Test-time Alignment with Affine-invariant Depth Prior

Lee Hyoseok, Kyeong Seon Kim, Kwon Byung-Ki, Tae-Hyun Oh

TL;DR

This paper introduces a zero-shot depth completion method that leverages the rich structural knowledge of pre-trained monocular depth diffusion foundation models. By introducing a test-time alignment strategy with hard constraints and a prior-based outlier filter, the method successfully maps affine-invariant depth priors to absolute metric scales. This approach achieves up to a 21% average performance improvement over previous state-of-the-art methods in out-of-domain scenarios without requiring any training data.

What Problem Does This Paper Address?

Depth completion aims to reconstruct a dense, metric-scale depth map from sparse depth measurements (such as those from LiDAR or SLAM systems) guided by an RGB image. Because sparse measurements leave most of the scene unobserved, this is a highly ill-posed problem that requires strong prior knowledge about scene structures.

Existing learning-based approaches typically train networks to propagate sparse depth values based on color or texture proximity. While these methods excel in-domain, they suffer from severe domain generalization issues. A model trained on clean, indoor data will fail miserably when deployed on an outdoor driving dataset due to variations in sensors, weather, and depth ranges.

Figure 1: 3D-lifted depth completion results in out-of-domain cases. Regardless of supervised (Zhang et al. 2023) or unsupervised methods (Wong and Soatto 2021), most depth completion models perform poorly on out-of-domain data. In contrast, our zero-shot depth completion method, which employs test-time alignment, consistently achieves robust results. In this example, the other models are trained on the KITTI Depth Completion dataset (Uhrig et al. 2017), while our zero-shot approach is not trained on any specific depth completion dataset. Both are tested on the nuScenes dataset (Caesar et al. 2020).

To overcome this, the authors look to generative foundation models, which already possess a deep, generalizable understanding of scene layouts and boundaries, and adapt them for zero-shot depth completion.

Methods

The core idea is to take a pre-trained monocular depth diffusion model (which operates in an up-to-scale, affine-invariant depth space) and align its predictions with sparse metric measurements at test time.

Figure 2: Illustration of our approach. At test time, we align the depth affinity from the prior (dashed lines) with the sparse depth measurements as a hard constraint (bold lines). This alignment propagates measurements across the scene to complete unobservable depth values.

The framework consists of three main components:

  1. Test-Time Alignment with Hard Constraints: Standard guided sampling for diffusion models alters the latents softly at each step, which often leads to corrupted or physically inconsistent depth maps due to the stochastic nature of diffusion. Instead, the authors propose a two-step optimization loop during the reverse sampling process. First, they optimize the estimated clean latent $z_0(z_t)$ to satisfy the sparse metric depth constraints. Second, they resample the optimized latent back to the intermediate noise level $z_t$ using a time-scheduled noise injection to preserve the diffusion model's generation trajectory.
  2. Prior-Based Outlier Filtering: Real-world LiDAR data contains noise and outliers (e.g., see-through points on glass windows). The authors use a superpixel algorithm to segment the relative depth prior. Within each segment, they apply RANSAC linear least-squares fitting to robustly map the relative depth to the metric sparse depth, filtering out points that deviate significantly from the consensus.
  3. Relative Structure Similarity (R-SSIM) Loss: To prevent the optimization loop from over-smoothing the scene details, the authors introduce a novel structure regularization loss derived from SSIM. By dropping the absolute luminance component, R-SSIM effectively transfers sharp structural details from the diffusion prior to the final metric depth map across different scale domains.
Figure 3: Test-time alignment process. We incorporate a two-step hard alignment process into the reverse sampling process including an optimization loop and resample at regular intervals. We optimize z0(zt) and remap it to ˆzt. The latent is then decoded into depth, where the loss is measured against sparse depth. For visibility, the sparse depth points are enlarged.

Datasets

The method was evaluated strictly in zero-shot, cross-domain scenarios across several prominent benchmarks:

  • Indoor: NYUv2, SceneNet, and VOID.
  • Outdoor: Waymo, nuScenes, and KITTI Depth Completion (KITTI DC).

Key Insights and Ideas

  • The Affine-to-Metric Bridge: Monocular depth foundation models are typically trained with scale- and shift-invariant losses, meaning they don't understand absolute meters. However, this paper empirically proves that the normalized metric depth space still lies within the generative distribution of these models. A simple test-time alignment is sufficient to ground relative structures into absolute metric scales.
  • Hard Constraints Beat Soft Guidance: Relying purely on standard gradient guidance during diffusion sampling fails for deterministic tasks like depth completion. Enforcing the sparse points as hard constraints via an explicit optimization-and-resampling loop is crucial to prevent the model from drifting into hallucinated, physically inaccurate structures.

Key Results

  • State-of-the-Art Generalization: When evaluated on out-of-domain datasets, the proposed method consistently outperformed existing test-time adaptation methods (like ProxyTTA). For instance, on the nuScenes dataset, it achieved an RMSE of 1.561 meters compared to ProxyTTA's 1.755 meters.
  • Model Agnostic: The framework was successfully validated using two different underlying depth diffusion foundation models: Marigold (50 sampling steps) and DepthFM (a highly efficient flow-matching model).
  • Efficiency Gains: By pairing the method with DepthFM, the inference time dropped from 101 seconds (Marigold) to just 16 seconds for a single-step generation, while retaining highly competitive depth completion accuracy.

Limitations and Future Work

The primary bottleneck of this method is its computational latency. Because it relies on an optimization loop embedded within the iterative reverse sampling process of a latent diffusion model, it is currently too slow for real-time robotics or autonomous driving applications.

The authors note that integrating recent acceleration techniques for diffusion models and guided sampling frameworks represents the most promising direction for future work to bring this robust, zero-shot capability to real-time systems.

Summary updated

BibTeX
@misc{hyoseok2025zero,
  author = {Lee Hyoseok and Kyeong Seon Kim and Kwon Byung-Ki and Tae-Hyun Oh},
  title = {{Zero-shot Depth Completion via Test-time Alignment with Affine-invariant Depth Prior}},
  year = {2025},
  eprint = {2502.06338},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2502.06338},
}
Figure