Align3R
[CVPR 2025 Highlight] Align3R: Aligned Monocular Depth Estimation for Dynamic Videos
Install / Use
/learn @jiah-cloud/Align3RREADME
[CVPR2025] Align3R: Aligned Monocular Depth Estimation for Dynamic Videos
<a href='https://arxiv.org/abs/2412.03079'><img src='https://img.shields.io/badge/arXiv-2412.03079-b31b1b.svg'></a>
<a href='https://igl-hkust.github.io/Align3R.github.io/'><img src='https://img.shields.io/badge/Project-Page-Green'></a>
Align3R: Aligned Monocular Depth Estimation for Dynamic Videos Jiahao Lu*, Tianyu Huang*, Peng Li, Zhiyang Dou, Cheng Lin, Zhiming Cui, Zhen Dong, Sai-Kit Yeung, Wenping Wang, Yuan Liu Arxiv, 2024.
Align3R estimates temporally consistent video depth, dynamic point clouds, and camera poses from monocular videos.

🔨TODO List:
- [x] Incorporate PromptDA to restore original resolution and achieve better details.
- [ ] Add evaluation for static scenes.
- [ ] Add more real dataset for training.
- [ ] Add camera pose and point correspondence prediction.
🚀 Quick Start
<details> <summary> 🛠️ Installation </summary>- Clone this repo:
git clone git@github.com:jiah-cloud/Align3R.git
- Install dependencies:
conda create -n align3r python=3.11 cmake=3.14.0
conda activate align3r
conda install pytorch torchvision pytorch-cuda=12.1 -c pytorch -c nvidia # use the correct version of cuda for your system
pip install -r requirements.txt
# Optional: you can also install additional packages to:
# - add support for HEIC images
# - add pyrender, used to render depthmap in some datasets preprocessing
# - add required packages for visloc.py
pip install -r requirements_optional.txt
- Compile the cuda kernels for RoPE (as in CroCo v2):
cd croco/models/curope/
python setup.py build_ext --inplace
cd ../../../
- Install the monocular depth estimation model Depth Pro and Depth Anything V2:
# Depth Pro
cd third_party/ml-depth-pro
pip install -e .
source get_pretrained_models.sh
# Depth Anything V2
pip install transformers==4.41.2
- Download the corresponding model weights:
🔥🔥🔥 We upload our model weights to the Hugging Face, now you can download them via Align3R (Depth Pro) and Align3R (Depth Anything V2).
# DUSt3R
wget https://download.europe.naverlabs.com/ComputerVision/DUSt3R/DUSt3R_ViTLarge_BaseDecoder_512_dpt.pth
# Align3R
# If you cannot download the weights using the following scripts, please download them locally.
gdown --fuzzy https://drive.google.com/file/d/1-qhRtgH7rcJMYZ5sWRdkrc2_9wsR1BBG/view?usp=sharing
gdown --fuzzy https://drive.google.com/file/d/1PPmpbASVbFdjXnD3iea-MRIHGmKsS8Vh/view?usp=sharing
# Depth Pro
cd third_party/ml-depth-pro
source get_pretrained_models.sh
# Raft
gdown --fuzzy https://drive.google.com/file/d/1KJxQ7KPuGHlSftsBCV1h2aYpeqQv3OI-/view?usp=drive_link -O models/
</details>
<details> <summary> 🔧 Dataset Preparation </summary>
To train Align3R, you should download the following dataset:
- SceneFlow (Includes FlyingThings3D, Driving & Monkaa)
- VKITTI
- TartanAir
- Spring
- PointOdyssey
Then use the following script to preprocess the training datasets:
bash datasets_preprocess/preprocess_trainingset.sh
After preprocessing, our folder structure is as follows:
├── data
├── PointOdyssey_proc
│ ├── train
│ └── val
├── spring_proc
│ └── train
├── Tartanair_proc
├── vkitti_2.0.3_proc
└── SceneFlow
├── FlyingThings3D_proc
│ ├── TRAIN
│ │ ├── A
│ │ ├── B
│ │ └── C
│ └── TEST
│ ├── A
│ ├── B
│ └── C
├── Driving_proc
│ ├── 35mm_focallength
│ └── 15mm_focallength
└── Monkaa_proc
To evaluate, you should download the following dataset:
- Sintel
- DAVIS
- Bonn
- TUM dynamics (Dynamic Objects: freiburg3)
For Bonn and TUM dynamics, you should use the following script to preprocess them:
bash datasets_preprocess/preprocess_testset.sh
Our folder structure is as follows:
├── data
├── bonn
│ └── rgbd_bonn_dataset
├── davis
│ └── DAVIS
│ ├── JPEGImages
│ │ ├── 480P
│ │ └── 1080P
│ ├── Annotations
│ │ ├── 480P
│ │ └── 1080P
│ └── ImageSets
│ ├── 480P
│ └── 1080P
├── MPI-Sintel
│ ├── MPI-Sintel-training_images
│ │ └── training
│ │ └── final
│ └── MPI-Sintel-depth-training
│ └── training
│ ├── camdata_left
│ └── depth
└── tum
To generate monocular depth maps, you should use the following script:
cd third_party/ml-depth-pro
bash infer.sh
</details>
<details> <summary> 🎇 Demo </summary>
You can run the following demo code on any video. The input path can be either a mp4 video or an image folder.
bash demo.sh

To produce results with the original resolution and enhanced details, you can try the following demo, which leverages PromptDA for depth map upsampling and refinement.
To get started, first install PromptDA by following their provided instructions, then proceed to run the demo below.
bash demo_refine.sh

Please use the viser to visualize the point cloud results, you can acquire the code from MonST3R. Thanks for their excellent work!
python viser/visualizer_monst3r.py --data path/dataset/video --init_conf --fg_conf_thre 1.0 --no_mask --wxyz
</details>
<details> <summary> 🌟 Training </summary>
Please download the pretrained DUSt3R weight before training.
bash train.sh
</details>
<details> <summary> 🎇 Evaluation </summary>
Video Depth
bash depth_test.sh
Please change the --dust3r_dynamic_model_path, --output_postfix, --dataset_name, --depth_prior_name.
Sintel
# Depth Pro
CUDA_VISIBLE_DEVICES='0' python tool/depth_test.py --dust3r_dynamic_model_path="align3r_depthpro.pth" --align_with_lad --depth_max=70 --depth_prior_name=depthpro --dataset_name=sintel --eval --output_postfix="results/sintel_depth_ours_depthpro"
# Depth Anything V2
CUDA_VISIBLE_DEVICES='0' python tool/depth_test.py --dust3r_dynamic_model_path="align3r_depthanything.pth" --align_with_lad --depth_max=70 --depth_prior_name=depthanything --dataset_name=sintel --eval --output_postfix="results/sintel_depth_ours_depthanything"
PointOdyssey
# Depth Pro
CUDA_VISIBLE_DEVICES='0' python tool/depth_test.py --dust3r_dynamic_model_path="align3r_depthpro.pth" --align_with_lad --depth_max=70 --depth_prior_name=depthpro --dataset_name=PointOdyssey --eval --output_postfix="results/PointOdyssey_depth_ours_depthpro"
# Depth Anything V2
CUDA_VISIBLE_DEVICES='0' python tool/depth_test.py --dust3r_dynamic_model_path="align3r_depthanything.pth" --align_with_lad --depth_max=70 --depth_prior_name=depthanything --dataset_name=PointOdyssey --eval --output_postfix="results/PointOdyssey_depth_ours_depthanything"
FlyingThings3D
# Depth Pro
CUDA_VISIBLE_DEVICES='0' python tool/depth_test.py --dust3r_dynamic_model_path="align3r_depthpro.pth" --align_with_lad --depth_max=70 --depth_prior_name=depthpro --dataset_name=FlyingThings3D --eval --output_postfix="results/FlyingThings3D_depth_ours_depthpro"
# Depth Anything V2
CUDA_VISIBLE_DEVICES='0' python tool/depth_test.py --dust3r_dynamic_model_path="align3r_depthanything.pth" --align_with_lad --depth_max=70 --depth_prior_name=depthanythin
