Update README.md (#10)
Browse files- Update README.md (e63efb8696a5ea69f930e4bf5941954f178d1b95)
README.md
CHANGED
|
@@ -56,7 +56,17 @@ The model card has been written in combination by the Hugging Face team and Inte
|
|
| 56 |
|
| 57 |
### How to use
|
| 58 |
|
| 59 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
|
| 61 |
```python
|
| 62 |
from transformers import DPTImageProcessor, DPTForDepthEstimation
|
|
|
|
| 56 |
|
| 57 |
### How to use
|
| 58 |
|
| 59 |
+
The easiest is leveraging the pipeline API:
|
| 60 |
+
|
| 61 |
+
```
|
| 62 |
+
from transformers import pipeline
|
| 63 |
+
|
| 64 |
+
pipe = pipeline(task="depth-estimation", model="Intel/dpt-large")
|
| 65 |
+
result = pipe(image)
|
| 66 |
+
result["depth"]
|
| 67 |
+
```
|
| 68 |
+
|
| 69 |
+
In case you want to implement the entire logic yourself, here's how to do that for zero-shot depth estimation on an image:
|
| 70 |
|
| 71 |
```python
|
| 72 |
from transformers import DPTImageProcessor, DPTForDepthEstimation
|