Update README.md
Browse files
README.md
CHANGED
@@ -34,7 +34,7 @@ fine-tuned versions on a task that interests you.
|
|
34 |
Here is how to use this model:
|
35 |
|
36 |
```python
|
37 |
-
from transformers import
|
38 |
import torch
|
39 |
import numpy as np
|
40 |
from PIL import Image
|
@@ -43,11 +43,11 @@ import requests
|
|
43 |
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
|
44 |
image = Image.open(requests.get(url, stream=True).raw)
|
45 |
|
46 |
-
|
47 |
model = GLPNForDepthEstimation.from_pretrained("vinvino02/glpn-nyu")
|
48 |
|
49 |
# prepare image for the model
|
50 |
-
inputs =
|
51 |
|
52 |
with torch.no_grad():
|
53 |
outputs = model(**inputs)
|
|
|
34 |
Here is how to use this model:
|
35 |
|
36 |
```python
|
37 |
+
from transformers import GLPNImageProcessor, GLPNForDepthEstimation
|
38 |
import torch
|
39 |
import numpy as np
|
40 |
from PIL import Image
|
|
|
43 |
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
|
44 |
image = Image.open(requests.get(url, stream=True).raw)
|
45 |
|
46 |
+
processor = GLPNImageProcessor.from_pretrained("vinvino02/glpn-nyu")
|
47 |
model = GLPNForDepthEstimation.from_pretrained("vinvino02/glpn-nyu")
|
48 |
|
49 |
# prepare image for the model
|
50 |
+
inputs = processor(images=image, return_tensors="pt")
|
51 |
|
52 |
with torch.no_grad():
|
53 |
outputs = model(**inputs)
|