nielsr HF staff commited on
Commit
142cb8c
1 Parent(s): 8f4b5ad

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-large')
41
  model = ViTMAEForPreTraining.from_pretrained('facebook/vit-mae-large')
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-large')
41
  model = ViTMAEForPreTraining.from_pretrained('facebook/vit-mae-large')
42
 
43
+ inputs = processor(images=image, return_tensors="pt")
44
  outputs = model(**inputs)
45
  loss = outputs.loss
46
  mask = outputs.mask