nielsr HF staff commited on
Commit
b5465ed
1 Parent(s): eec5f77

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +3 -3
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 GLPNFeatureExtractor, GLPNForDepthEstimation
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
- feature_extractor = GLPNFeatureExtractor.from_pretrained("vinvino02/glpn-nyu")
47
  model = GLPNForDepthEstimation.from_pretrained("vinvino02/glpn-nyu")
48
 
49
  # prepare image for the model
50
- inputs = feature_extractor(images=image, return_tensors="pt")
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)