File size: 2,104 Bytes
6a27cf6
 
 
f87dbde
 
 
 
 
 
 
 
 
6a27cf6
f87dbde
 
6a27cf6
f87dbde
 
bff81ae
f87dbde
bff81ae
f87dbde
 
 
 
 
 
 
 
 
 
 
 
 
01c40b7
f87dbde
 
 
 
 
 
 
 
 
 
bff81ae
f87dbde
 
 
 
 
 
 
 
 
bff81ae
f87dbde
 
 
 
 
 
 
 
 
 
 
 
bff81ae
 
 
 
 
f87dbde
 
 
 
 
6145115
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
---
license: apache-2.0
language:
  - en
tags:
  - depth-estimation
  - colonoscopy
  - medical-imaging
  - video
  - lora
  - diffusion
library_name: transformers
base_model:
  - tencent/DepthCrafter
  - stabilityai/stable-video-diffusion-img2vid-xt
pipeline_tag: depth-estimation
---

# ColonCrafter: A Depth Estimation Model for Colonoscopy Videos Using Diffusion Priors

ColonCrafter builds upon [DepthCrafter](https://huggingface.co/tencent/DepthCrafter) and [Stable Video Diffusion](https://huggingface.co/stabilityai/stable-video-diffusion-img2vid-xt) to provide temporally consistent depth predictions for colonoscopy video.

## Model Details

- **Model Type:** Video Depth Estimation (Diffusion-based)
- **Base Architecture:** DepthCrafter UNet with LoRA adaptation
- **LoRA Configuration:**
  - Rank: 16
  - Target modules: `to_q`, `to_k`, `to_v`, `to_out.0`
  - Dropout: 0.1
- **Precision:** FP16

## Installation

Please refer to the installation instructions in our [repository](https://github.com/rajpurkarlab/ColonCrafter). 

## Usage

```python
import torch
from src.depth.models.model import ColonCrafterInference

# Load the model
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model = ColonCrafterInference.from_pretrained(
    "romainhardy/coloncrafter",
    device=device
)

# Prepare video tensor: (N, C, H, W) in [0, 1] range
# video = ...

# Run inference
pred_depth, pred_disparity = model.predict_depth(
    video,
    num_inference_steps=1,
    window_size=16,
    overlap=8,
    guidance_scale=1.0,
    seed=42
)
```

## Citation

If you use this model in your research, please cite:

```bibtex
@article{hardy2025coloncrafter,
  title={ColonCrafter: A Depth Estimation Model for Colonoscopy Videos Using Diffusion Priors},
  author={Hardy, Romain and Berzin, Tyler and Rajpurkar, Pranav},
  journal={arXiv preprint arXiv:2509.13525},
  year={2025}
}
```

## Acknowledgments

This model builds upon [DepthCrafter](https://github.com/Tencent/DepthCrafter) and [Stable Video Diffusion](https://huggingface.co/stabilityai/stable-video-diffusion-img2vid-xt).