Adding an example for `depth-estimation` pipeline. (#20237)
* Adding an example for `depth-estimation` pipeline. * Adding missing internal link to tutorial.
This commit is contained in:
parent
1f029b6ae7
commit
4fb34de99e
|
@ -24,6 +24,21 @@ class DepthEstimationPipeline(Pipeline):
|
|||
"""
|
||||
Depth estimation pipeline using any `AutoModelForDepthEstimation`. This pipeline predicts the depth of an image.
|
||||
|
||||
Example:
|
||||
|
||||
```python
|
||||
>>> from transformers import pipeline
|
||||
|
||||
>>> depth_estimator = pipeline(task="depth-estimation", model="Intel/dpt-large")
|
||||
>>> output = depth_estimator("http://images.cocodataset.org/val2017/000000039769.jpg")
|
||||
>>> # This is a tensor with the values being the depth expressed in meters for each pixel
|
||||
>>> output["predicted_depth"].shape
|
||||
torch.Size([1, 384, 384])
|
||||
```
|
||||
|
||||
[Using pipelines in a webserver or with a dataset](../pipeline_tutorial)
|
||||
|
||||
|
||||
This depth estimation pipeline can currently be loaded from [`pipeline`] using the following task identifier:
|
||||
`"depth-estimation"`.
|
||||
|
||||
|
|
Loading…
Reference in New Issue