"images/git@developer.sourcefind.cn:cnjsdfcy/simbricks.git" did not exist on "700e13362d4ad3adcf9efff00e294acc6fe2e290"
Unverified Commit 4fb34de9 authored by Nicolas Patry's avatar Nicolas Patry Committed by GitHub
Browse files

Adding an example for `depth-estimation` pipeline. (#20237)

* Adding an example for `depth-estimation` pipeline.

* Adding missing internal link to tutorial.
parent 1f029b6a
...@@ -24,6 +24,21 @@ class DepthEstimationPipeline(Pipeline): ...@@ -24,6 +24,21 @@ class DepthEstimationPipeline(Pipeline):
""" """
Depth estimation pipeline using any `AutoModelForDepthEstimation`. This pipeline predicts the depth of an image. 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: This depth estimation pipeline can currently be loaded from [`pipeline`] using the following task identifier:
`"depth-estimation"`. `"depth-estimation"`.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment