nielsr HF staff commited on
Commit
f205d5d
1 Parent(s): 400c0ca

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +4 -3
README.md CHANGED
@@ -33,16 +33,17 @@ fine-tuned versions on a task that interests you.
33
  Here is how to use this model:
34
 
35
  ```python
36
- from transformers import ViTFeatureExtractor, ViTModel
37
  from PIL import Image
38
  import requests
39
 
40
  url = 'http://images.cocodataset.org/val2017/000000039769.jpg'
41
  image = Image.open(requests.get(url, stream=True).raw)
42
 
43
- feature_extractor = ViTFeatureExtractor.from_pretrained('facebook/dino-vitb16')
44
  model = ViTModel.from_pretrained('facebook/dino-vitb16')
45
- inputs = feature_extractor(images=image, return_tensors="pt")
 
46
  outputs = model(**inputs)
47
  last_hidden_states = outputs.last_hidden_state
48
  ```
 
33
  Here is how to use this model:
34
 
35
  ```python
36
+ from transformers import ViTImageProcessor, ViTModel
37
  from PIL import Image
38
  import requests
39
 
40
  url = 'http://images.cocodataset.org/val2017/000000039769.jpg'
41
  image = Image.open(requests.get(url, stream=True).raw)
42
 
43
+ processor = ViTImageProcessor.from_pretrained('facebook/dino-vitb16')
44
  model = ViTModel.from_pretrained('facebook/dino-vitb16')
45
+
46
+ inputs = processor(images=image, return_tensors="pt")
47
  outputs = model(**inputs)
48
  last_hidden_states = outputs.last_hidden_state
49
  ```