Update README.md
Browse files
README.md
CHANGED
@@ -59,7 +59,7 @@ The model card has been written in combination by the Hugging Face team and Inte
|
|
59 |
Here is how to use this model for zero-shot depth estimation on an image:
|
60 |
|
61 |
```python
|
62 |
-
from transformers import
|
63 |
import torch
|
64 |
import numpy as np
|
65 |
from PIL import Image
|
@@ -68,11 +68,11 @@ import requests
|
|
68 |
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
|
69 |
image = Image.open(requests.get(url, stream=True).raw)
|
70 |
|
71 |
-
|
72 |
model = DPTForDepthEstimation.from_pretrained("Intel/dpt-large")
|
73 |
|
74 |
# prepare image for the model
|
75 |
-
inputs =
|
76 |
|
77 |
with torch.no_grad():
|
78 |
outputs = model(**inputs)
|
|
|
59 |
Here is how to use this model for zero-shot depth estimation on an image:
|
60 |
|
61 |
```python
|
62 |
+
from transformers import DPTImageProcessor, DPTForDepthEstimation
|
63 |
import torch
|
64 |
import numpy as np
|
65 |
from PIL import Image
|
|
|
68 |
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
|
69 |
image = Image.open(requests.get(url, stream=True).raw)
|
70 |
|
71 |
+
processor = DPTImageProcessor.from_pretrained("Intel/dpt-large")
|
72 |
model = DPTForDepthEstimation.from_pretrained("Intel/dpt-large")
|
73 |
|
74 |
# prepare image for the model
|
75 |
+
inputs = processor(images=image, return_tensors="pt")
|
76 |
|
77 |
with torch.no_grad():
|
78 |
outputs = model(**inputs)
|