nielsr HF staff commited on
Commit
f4bf8a5
1 Parent(s): 87dd4fa

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +3 -3
README.md CHANGED
@@ -30,17 +30,17 @@ fine-tuned versions on a task that interests you.
30
  Here is how to use this model:
31
 
32
  ```python
33
- from transformers import AutoFeatureExtractor, ViTMAEForPreTraining
34
  from PIL import Image
35
  import requests
36
 
37
  url = 'http://images.cocodataset.org/val2017/000000039769.jpg'
38
  image = Image.open(requests.get(url, stream=True).raw)
39
 
40
- feature_extractor = AutoFeatureExtractor.from_pretrained('facebook/vit-mae-base')
41
  model = ViTMAEForPreTraining.from_pretrained('facebook/vit-mae-base')
42
 
43
- inputs = feature_extractor(images=image, return_tensors="pt")
44
  outputs = model(**inputs)
45
  loss = outputs.loss
46
  mask = outputs.mask
 
30
  Here is how to use this model:
31
 
32
  ```python
33
+ from transformers import AutoImageProcessor, ViTMAEForPreTraining
34
  from PIL import Image
35
  import requests
36
 
37
  url = 'http://images.cocodataset.org/val2017/000000039769.jpg'
38
  image = Image.open(requests.get(url, stream=True).raw)
39
 
40
+ processor = AutoImageProcessor.from_pretrained('facebook/vit-mae-base')
41
  model = ViTMAEForPreTraining.from_pretrained('facebook/vit-mae-base')
42
 
43
+ inputs = processor(images=image, return_tensors="pt")
44
  outputs = model(**inputs)
45
  loss = outputs.loss
46
  mask = outputs.mask