nielsr HF staff commited on
Commit
a8985c0
1 Parent(s): b8ef583

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +3 -3
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 DPTFeatureExtractor, DPTForDepthEstimation
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
- feature_extractor = DPTFeatureExtractor.from_pretrained("Intel/dpt-large")
72
  model = DPTForDepthEstimation.from_pretrained("Intel/dpt-large")
73
 
74
  # prepare image for the model
75
- inputs = feature_extractor(images=image, return_tensors="pt")
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)