-
Notifications
You must be signed in to change notification settings - Fork 25.2k
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
Add ZoeDepth #30136
base: main
Are you sure you want to change the base?
Add ZoeDepth #30136
Conversation
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
Fixed #30634 |
Hi @amyeroberts addressed all comments, CI is green |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the continued work on this!
There's still a few structural pieces to tidy up, but looking close to merge!
outputs = model(**inputs) | ||
predicted_depth = outputs.predicted_depth | ||
|
||
# interpolate to original size |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is to be done in a follow-up, an issue should be made to make sure it's actually done
... predicted_depth = outputs.predicted_depth | ||
|
||
>>> # interpolate to original size | ||
>>> prediction = torch.nn.functional.interpolate( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has an issue / feature request been opened?
return self.log_binomial_transform(probabilities, temperature) | ||
|
||
|
||
class ZoeDepthSeedBinRegressor(nn.Module): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have them in one class in the attractor. There's already a lot of if/else logic in the forward pass, I don't think this would make much of a difference. Up to you depending on whether you care more about the consistency or not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the work adding this model! Looks nearly ready to merge.
A few final things to do before:
- Run slow tests for beit and data2vec. This can be done through pushing an empty commit
[run-slow] beit data2vec
- Run the doc examples and confirm (with screenshot?) that they're passing
- Clarify the norming logic
The final bit that needs to be confirmed/addressed is making sure that this model doesn't suffer from the same issues that have been seen in the DPT model #28292 (as some of this is copied from) i.e. the model shouldn't create weights that never used.
|
||
def test_keep_aspect_ratio(self): | ||
size = {"height": 512, "width": 512} | ||
image_processor = ZoeDepthImageProcessor(size=size, keep_aspect_ratio=True, ensure_multiple_of=32) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It shouldn't be necessary to have to look at that function to figure out how these arguments interact - this should be made clear in the docstring. In particular, which one takes precedence.
This still needs to be tested here for different combinations. At the moment keep_aspect_ratio=False
is untested
Ok, Pushed an empty commit to run the slow tests which confirmed all slow test are passing, the doc tests are tested by the |
No, this checks the documentation can be built i.e. the webpage. See: https://huggingface.co/docs/transformers/main/en/testing#run-documentation-tests |
Sorry I meant the |
Ah, yes, that should be fine as long as the docs and model examples are tested. The only thing is from the recent CI workflow, it doesn't look like the tests have properly run (?). At least, it's not possible to see which tests have run at all there |
@amyeroberts feel free to approve the PR as all comments have been addressed |
What does this PR do?
This PR adds ZoeDepth as introduced in ZoeDepth: Zero-shot Transfer by Combining Relative and Metric Depth.
To do:
backbone_hidden_size
?