Skip to content
This repository was archived by the owner on Jul 5, 2026. It is now read-only.
Haruko386Public archive

About

Training code for Stage 1 of the ApDepth deep estimation.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

ApDepth: Aiming for Precise Monocular Depth Estimation Based on Diffusion Models

Stage 1: Feature Alignment and Structure Learning

           

This repository contains the official implementation for the First Stage (Feature Alignment) of ApDepth. In this stage, we establish a robust semantic foundation by explicitly aligning the intermediate features of the denoising U-Net with high-quality semantic representations from a pre-trained external encoder (DINOv2) using a spatial-preserving Conv Adapter and a Cosine Similarity loss.

⚙️ Installation

Please refer to installation.md for environment setup and dependencies.

🗄️ Data Preparation

Modify the data directory in the training script scripts/train_s1.sh:

BASE_DATA_DIR=YOUR_DATA_DIR  # directory of training data

Prepare the Hypersim and Virtual KITTI 2 datasets and save them into ${BASE_DATA_DIR} following the data structure protocol of Marigold.

📥 Checkpoint Preparation

Modify the checkpoint directory in scripts/train_s1.sh:

BASE_CKPT_DIR=YOUR_CHECKPOINT_DIR  # directory of pretrained checkpoint
  1. Diffusion Backbone: Download the Stable Diffusion v2 checkpoint into ${BASE_CKPT_DIR}.
  2. External Semantic Encoder: Download the checkpoint of DINOv2 into the checkpoints/ directory (This provides the patch-level semantic priors for feature alignment).

🏋️ Training (Stage 1)

Once the datasets and checkpoints are properly set up, you can start the first-stage training (Feature Alignment) by running the following script:

bash scripts/train_s1.sh

Note: The first stage is trained for 20,000 iterations purely in the feature space to prevent the network from prematurely overfitting to low-level texture details.

🤝 Acknowledgements

Our code is built upon the foundational work of Marigold and DepthMaster. We also profoundly thank the developers of DINOv2 for providing the exceptional pre-trained vision foundation models.

🎫 License

This work is licensed under the Apache License, Version 2.0 (as defined in the LICENSE).

About

Training code for Stage 1 of the ApDepth deep estimation.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages