nielsr HF staff commited on
Commit
0b87cde
1 Parent(s): edc1dd9
Files changed (1) hide show
  1. README.md +3 -3
README.md CHANGED
@@ -30,16 +30,16 @@ fine-tuned versions on a task that interests you.
30
 
31
  ### How to use
32
 
33
- Here is how to use this model to classify an image of the COCO 2017 dataset into one of the 21k ImageNet-21k classes:
34
 
35
  ```python
36
- from transformers import ViTFeatureExtractor, ViTForImageClassification
37
  from PIL import Image
38
  import requests
39
  url = 'http://images.cocodataset.org/val2017/000000039769.jpg'
40
  image = Image.open(requests.get(url, stream=True).raw)
41
  feature_extractor = ViTFeatureExtractor.from_pretrained('google/vit-base-patch16-224-in21k')
42
- model = ViTForImageClassification.from_pretrained('google/vit-base-patch16-224-in21k')
43
  inputs = feature_extractor(images=image, return_tensors="pt")
44
  outputs = model(**inputs)
45
  last_hidden_state = outputs.last_hidden_state
 
30
 
31
  ### How to use
32
 
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
  url = 'http://images.cocodataset.org/val2017/000000039769.jpg'
40
  image = Image.open(requests.get(url, stream=True).raw)
41
  feature_extractor = ViTFeatureExtractor.from_pretrained('google/vit-base-patch16-224-in21k')
42
+ model = ViTModel.from_pretrained('google/vit-base-patch16-224-in21k')
43
  inputs = feature_extractor(images=image, return_tensors="pt")
44
  outputs = model(**inputs)
45
  last_hidden_state = outputs.last_hidden_state