# CD-Depth

This repo provides an official PyTorch implementation of "CD-Depth: Cross-Domain Depth Estimation via Domain-Agnostic Latent Mapping and Adaptive Attention Window" (ICLR 2023 submission).

## Setup
```shell
conda create -n cddepth python=3.8.5
conda activate cddepth
conda install pytorch torchvision cudatoolkit=11.3 -c pytorch
pip install -r requirements.txt
```

Our experiments have been done with PyTorch 1.10.1, CUDA 11.4, Python 3.8.5 and Ubuntu 18.04. 
We use  a single NVIDIA RTX A6000 for training, but you can still run our code with GPUs which have smaller memory by reducing the batch size. 

## Evaluation
```shell
bash scripts/evaluate.sh
```

Please change the "data_path" flag where your KITTI dataset is located.
Download the pretrained weights and place them in the folder named "checkpoints".

[Download pretrained_weights](https://drive.google.com/file/d/1Q9lMsJnDnU2_z5FiC0gmx6xpNqOcMY7X/view?usp=sharing)
## Training

Training code will be publicly open after camera-ready submission.