Open bt2513 opened 3 weeks ago
Hi @bt2513, thanks for the issue, I suppose the feature "metric depth" for DepthAnything is not in the 4.44.0
release, but you can use it if update transformers to the latest main
.
pip install git+https://github.com/huggingface/transformers
Thanks @qubvel , it does work when I install transformers this way indeed! When is the feature "metric depth" for DepthAnything going to be released? Is there something I can do to help with this? Just asking because it seems that if people try to use the model by following the current instructions on the model card, they will run into the same issue as me
Thanks for your help, we just have to wait a bit, in a week or two there will be a new 4.45.0
release with this feature included!
One more thing we can do is add information regarding the minimum transformers
version to a model card on the Hub, would you like to open a PR on the Hub?
Sure! Would you have an example of model card showing this that I can take as an example?
Or should I simply edit the model card title by something like Depth Anything V2 (Fine-tuned for Metric Depth Estimation) - Transformers Version (4.45.0+)
for instance
Or alternatively have a small text below the title such as: "Prerequisite: transformers version 4.45.0 or later. Alternatively, use transformers latest main
with pip install git+https://github.com/huggingface/transformers
"
@bt2513 yes, it should be good with something like
...
## Requirements:
`transformers>=4.45.0`
Alternatively, use `transformers` latest version installed from the source:
\```
pip install git+https://github.com/huggingface/transformers
\```
...
(without "\")
System Info
transformers
version: 4.44.0Who can help?
@amyeroberts @NielsRogge
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction
I just came back from vacation and noticed some issues raised with the Depth Anything V2 models (for metric depth estimation) on the hub. They seem to happen because when loading any of those models, the output activation function should be a Sigmoid but it is a ReLU instead:
The model print is the following, and the output logits are incorrect because of the wrong activation function used (and it also looks like the output is not scaled by
max_depth
from what I observed when playing with a toy example):Expected behavior
The output activation function should be a Sigmoid at the end for
activation2
and the logits should be scaled bymax_depth
correctly:It looks like the model is incorrectly initialized despite having the expected model config and the attributes
max_depth
anddepth_estimation_type
correctly set. The updatedDepthAnythingDepthEstimationHead
code in modeling_depth_anything doesn't seem applied for some reason during model initialization - or maybe the issue lies elsewhere. Any thoughts why this is happening @amyeroberts @NielsRogge? Please let me know your thoughts and happy to open a PR to make a fix!