Fix typo in code example
Browse files
README.md
CHANGED
@@ -32,13 +32,13 @@ fine-tuned versions on a task that interests you.
|
|
32 |
Here is how to use this model to classify an image of the COCO 2017 dataset into one of the 1,000 ImageNet classes:
|
33 |
|
34 |
```python
|
35 |
-
from transformers import
|
36 |
from PIL import Image
|
37 |
import requests
|
38 |
url = 'http://images.cocodataset.org/val2017/000000039769.jpg'
|
39 |
image = Image.open(requests.get(url, stream=True).raw)
|
40 |
-
feature_extractor =
|
41 |
-
model =
|
42 |
inputs = feature_extractor(images=image, return_tensors="pt")
|
43 |
outputs = model(**inputs)
|
44 |
logits = outputs.logits
|
|
|
32 |
Here is how to use this model to classify an image of the COCO 2017 dataset into one of the 1,000 ImageNet classes:
|
33 |
|
34 |
```python
|
35 |
+
from transformers import BeitFeatureExtractor, BeitForImageClassification
|
36 |
from PIL import Image
|
37 |
import requests
|
38 |
url = 'http://images.cocodataset.org/val2017/000000039769.jpg'
|
39 |
image = Image.open(requests.get(url, stream=True).raw)
|
40 |
+
feature_extractor = BeitFeatureExtractor.from_pretrained('microsoft/beit-base-patch16-224-pt22k-ft22k')
|
41 |
+
model = BeitForImageClassification.from_pretrained('microsoft/beit-base-patch16-224-pt22k-ft22k')
|
42 |
inputs = feature_extractor(images=image, return_tensors="pt")
|
43 |
outputs = model(**inputs)
|
44 |
logits = outputs.logits
|