-
Notifications
You must be signed in to change notification settings - Fork 27.7k
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 depth estimation pipeline #18618
Add depth estimation pipeline #18618
Conversation
The documentation is not available anymore as the PR was closed or merged. |
143d331
to
fed82a2
Compare
Hi @NielsRogge @Narsil I tried debugging to resolve above issue, I found that in
Can you guide me to resolve this error. |
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.
Great PR, you also need to add
+ def _sanitize_parameters(self, **kwargs):
+ return {}, {}, {}
+
To the pipeline, it's not used but the base class expects this method to exist. (Here there's not parameters declared so it's quite easy.
This weird method exist to allow parameters to be defined both at definition time or call tiime
pipe = pipeline(model=model, myargs=1)
data = pipe(image)
# or
pipe = pipeline(model=model)
data = pipe(image, myargs=1)
Cheers !
Otherwise LGTM.
Why do you output 3 different images ? That sounds like a lot.
The image I can understand, the predicted depth is defined in what unit ? Is it noisy hence the interpolation ?
IMO that seems like something to be left to the user to decide what to do.
In general I think a pure image would be nice (to be a bit more general) but I can understand that the loss of precision might be harmful, do you mind sharing how you use those numbers ? Maybe we could output an other time of image that doesn't loose information (keeping f32 pixel)
Wdyt ?
930d335
to
e80aadd
Compare
I just saw |
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.
LGTM.
Aside from the missing generic test.
Would you like us to write it ? (It's not too hard to write I think).
My biggest question is why depth-estimation
needs it's own pipeline.
I understand in the robotics context you really want something that's not an image, but really a matrix with depth (expressed iin meters I guess).
This reason only makes me ok with the idea of creating this pipeline as is.
But ideally it would be nice if the output was an image (so it could become image-generation
) with either an output that would be trivial to transform into a depth map or a parameter.
@mishig25 maybe for advice ideas on the widget that could be different than an image/generation here ?
In any case, expect if anyone has better ideas counterarguments, we should just merge this right now (after having the generic test), and maybe later convert this to an alias if we decide to merge.
9d57e01
to
df4ed06
Compare
By generic test did you mean |
5d97e03
to
7d5dd21
Compare
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread. Please note that issues that do not follow the contributing guidelines are likely to be ignored. |
Hi @nandwalritik, could you revive this PR by rebasing with the main branch? |
c5e7df6
to
0a1fb70
Compare
Done. |
@nandwalritik Do you want to help to get the PR green ? |
@Narsil Yeah please , I tried but I was not able to make the test cases pass. |
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.
Added some comments on how I fixed the CI for you.
<<<<<<< HEAD | ||
- [`DocumentQuestionAnsweringPipeline`] | ||
======= | ||
- [`DepthEstimationPipeline`] | ||
>>>>>>> Add initial files for depth estimation pipelines |
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.
This was a leftover from a bad rebase I think, I removed those lines and put back the documentation in alphabetical order.
### DocumentQuestionAnsweringPipeline | ||
|
||
[[autodoc]] DocumentQuestionAnsweringPipeline | ||
- __call__ | ||
- all | ||
|
||
======= | ||
### DepthEstimationPipeline |
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.
Same here.
@@ -1,7 +1,6 @@ | |||
from typing import List, Union | |||
|
|||
import numpy as np | |||
import torch |
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.
torch
is not a mandatory dependency, we need to import it only when it's OK to do so.
@@ -32,6 +30,9 @@ | |||
from .test_pipelines_common import ANY, PipelineTestCaseMeta | |||
|
|||
|
|||
if is_torch_available(): | |||
import torch |
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.
Same in tests.
require_vision, | ||
slow, | ||
) | ||
from transformers.testing_utils import nested_simplify, require_tf, require_timm, require_torch, require_vision, slow |
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.
Since you create your PR and today we removed is_pipeline_test
as we're now passing on these tests based on directory not by ENV variable.
Thanks I will look at them. |
4fd5e5f
to
31a08bd
Compare
@sgugger for final review. |
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.
LGTM! Thanks a lot for your work on this!
Co-authored-by: Sylvain Gugger <[email protected]>
@sgugger the test failure seem unrelated to the PR, should we go ahead and merge ? |
Yes, those are flaky tests. |
What does this PR do?
Fixes #18446
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
@NielsRogge @Narsil
Error While using the pipeline