Skip to content

Commit 8f5c574

Browse files
authored
Create README.md
1 parent 6f2f6a4 commit 8f5c574

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

DPT/README.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# DPT notebooks
2+
3+
DPT (Dense Prediction Transformer) is a model that can be used for dense prediction tasks (meaning, predicting things per pixel), such as depth estimation and semantic segmentation.
4+
5+
DPT was recently updated to leverage the `AutoBackbone` class, which enables it to leverage any `xxxBackbone` class in the Transformers library. This means that one can combine DPT
6+
with a DINOv2 backbone, for instance:
7+
8+
```
9+
from transformers import Dinov2Config, DPTConfig, DPTForDepthEstimation
10+
11+
backbone_config = Dinov2Config.from_pretrained("facebook/dinov2-base", out_features=["stage1", "stage2", "stage3", "stage4"])
12+
config = DPTConfig(backbone_config=backbone_config)
13+
14+
model = DPTForDepthEstimation(config=config)
15+
```
16+
17+
DPT checkpoints are on the hub, e.g.: https://huggingface.co/Intel/dpt-large
18+
19+
DPT checkpoints with a DINOv2 backbone are also on the hub: https://huggingface.co/models?pipeline_tag=depth-estimation&other=dinov2&sort=trending.

0 commit comments

Comments
 (0)