Run this model with HF Jobs
Run Intel/dpt-beit-large-384 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/Intel/dpt-beit-large-384. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/Intel/dpt-beit-large-384 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use Intel/dpt-beit-large-384 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Intel/dpt-beit-large-384 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("depth-estimation", model="Intel/dpt-beit-large-384")# pip install -U transformers accelerate # Load model directly from transformers import AutoImageProcessor, AutoModelForDepthEstimation processor = AutoImageProcessor.from_pretrained("Intel/dpt-beit-large-384") model = AutoModelForDepthEstimation.from_pretrained("Intel/dpt-beit-large-384", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Create README.md
#1
by nielsr HF Staff - opened
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263---license: mit---
# DPT 3.1 (BEiT backbone)
DPT (Dense Prediction Transformer) model trained on 1.4 million images for monocular depth estimation. It was introduced in the paper [Vision Transformers for Dense Prediction](https://arxiv.org/abs/2103.13413) by Ranftl et al. (2021) and first released in [this repository](https://github.com/isl-org/MiDaS/tree/master).
Disclaimer: The team releasing DPT did not write a model card for this model so this model card has been written by the Hugging Face team.
## Model description
This DPT model uses the [BEiT](https://huggingface.co/docs/transformers/model_doc/beit) model as backbone and adds a neck + head on top for monocular depth estimation.

## How to use
Here is how to use this model for zero-shot depth estimation on an image:
```pythonfrom transformers import DPTImageProcessor, DPTForDepthEstimationimport torchimport numpy as npfrom PIL import Imageimport requests
url = "http://images.cocodataset.org/val2017/000000039769.jpg"image = Image.open(requests.get(url, stream=True).raw)
processor = DPTImageProcessor.from_pretrained("Intel/dpt-beit-large-384")model = DPTForDepthEstimation.from_pretrained("Intel/dpt-beit-large-384")
# prepare image for the modelinputs = processor(images=image, return_tensors="pt")
with torch.no_grad(): outputs = model(**inputs) predicted_depth = outputs.predicted_depth
# interpolate to original sizeprediction = torch.nn.functional.interpolate( predicted_depth.unsqueeze(1), size=image.size[::-1], mode="bicubic", align_corners=False,)
# visualize the predictionoutput = prediction.squeeze().cpu().numpy()formatted = (output * 255 / np.max(output)).astype("uint8")depth = Image.fromarray(formatted)```
or one can use the pipeline API:
```pythonfrom transformers import pipeline
pipe = pipeline(task="depth-estimation", model="Intel/dpt-beit-large-384")result = pipe("http://images.cocodataset.org/val2017/000000039769.jpg")result["depth"]```README.mdAdded+63