Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DPT 3.1 models are now available in the Transformers library #259

Open
NielsRogge opened this issue Dec 22, 2023 · 1 comment
Open

DPT 3.1 models are now available in the Transformers library #259

NielsRogge opened this issue Dec 22, 2023 · 1 comment

Comments

@NielsRogge
Copy link

NielsRogge commented Dec 22, 2023

Hi folks!

DPT 3.1 (and the older DPT 3.0) models are now available for use in the Transformers library! These include:

Inference can be done in a few lines of code (using the pipeline API):

from transformers import pipeline

pipe = pipeline(task="depth-estimation", model="Intel/dpt-beit-base-384")
result = pipe("http://images.cocodataset.org/val2017/000000039769.jpg")
result["depth"]

The documentation of DPT can be found here: https://huggingface.co/docs/transformers/model_doc/dpt.

Example notebooks can be found here: https://github.com/NielsRogge/Transformers-Tutorials/tree/master/DPT.

@FabianSchuetze
Copy link

FabianSchuetze commented Dec 26, 2023

Thanks for updating the DPT models in transformers.

Can you explain what the corresponding scratch network would be in hf/Transformers?

Edit: I saw this file: https://github.com/huggingface/transformers/blob/main/src/transformers/models/dpt/convert_dpt_beit_to_hf.py which explains the relationship between the models.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants