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

Support Distill Depth Anything #36499

Open
2 tasks done
oxysoft opened this issue Mar 2, 2025 · 4 comments · May be fixed by #36614
Open
2 tasks done

Support Distill Depth Anything #36499

oxysoft opened this issue Mar 2, 2025 · 4 comments · May be fixed by #36614

Comments

@oxysoft
Copy link

oxysoft commented Mar 2, 2025

Model description

Excellent new depth estimation model just dropped. Would be great to be able to use it from the hub in a few lines like the other models.

Open source status

  • The model implementation is available
  • The model weights are available

Provide useful links for the implementation

https://github.com/Westlake-AGI-Lab/Distill-Any-Depth

@qubvel
Copy link
Member

qubvel commented Mar 3, 2025

Hi @oxysoft! Thanks for opening the feature request. 🤗 As far as I understand adding support for this model should be straightforward because the model has the same architecture as DepthAnything (DA), so the ideas is to use DA conversion script to convert checkpoints and upload them to the Hub in the new format, compatible with 🤗 Transformers.

@keetrap
Copy link
Contributor

keetrap commented Mar 3, 2025

Hi @qubvel ,

I’m interested in working on this, but I have a few questions:

DA Conversion Script: From what I understand, the current DA conversion script won't work as-is because the weights are already in safetensors format, and the key names are also different. So, I assume we’ll need to modify the DA script to handle this format and key name differences. Would you agree?

Uploading the Files: Once the conversion to the compatible format is complete, where should the converted files be uploaded?
Also, I’ve created a compatible version of the files, which you can find here: Distil-Any-Depth-Large-hf

Model Directory: Regarding the location of the changes, should they go into the existing "depth_anything" model directory, or would it be better to create a new model dir (e.g., something like "distill_depth_anything") to house these changes?

Sorry if my questions sound basic—I'm new to contributing models to the Transformers library and just want to make sure I’m following the correct process!

Thanks again for your help!

@keetrap
Copy link
Contributor

keetrap commented Mar 5, 2025

@qubvel, just a gentle reminder.

@qubvel
Copy link
Member

qubvel commented Mar 5, 2025

Hey @keetrap, thanks for the ping, I missed the message 🤗

DA Conversion Script: From what I understand, the current DA conversion script won't work as-is because the weights are already in safetensors format, and the key names are also different. So, I assume we’ll need to modify the DA script to handle this format and key name differences. Would you agree?

Yes, in case the current script is not working, we can have a second version of the script which convert distil model

Uploading the Files: Once the conversion to the compatible format is complete, where should the converted files be uploaded? Also, I’ve created a compatible version of the files, which you can find here: Distil-Any-Depth-Large-hf

Once it compele, we can tag model authors here to ask if they want to manage it under their own org on HF Hub, otherwise we can create a community org and put it there.

Model Directory: Regarding the location of the changes, should they go into the existing "depth_anything" model directory, or would it be better to create a new model dir (e.g., something like "distill_depth_anything") to house these changes?

Can you provide a few more details on the changes? If it's super minor, we can have this integrated under the same model, otherwise, it's better to submit a new PR for a new model. You can open a PR and tag me and we will decide whether we should create a new model for that

Thanks for interest in contribution!

@keetrap keetrap linked a pull request Mar 8, 2025 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants