nielsr HF staff commited on
Commit
e9e8485
1 Parent(s): 1284de7

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-kitti")
47
  model = GLPNForDepthEstimation.from_pretrained("vinvino02/glpn-kitti")
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-kitti")
47
  model = GLPNForDepthEstimation.from_pretrained("vinvino02/glpn-kitti")
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)