Update README.md (#2)
Browse files- Update README.md (179a8a0569f47024343c533291b6b260ef3eac28)
README.md
CHANGED
@@ -31,15 +31,15 @@ fine-tuned versions on a task that interests you.
|
|
31 |
Here is how to use this model to classify an image of the COCO 2017 dataset into one of the 1,000 ImageNet classes:
|
32 |
|
33 |
```python
|
34 |
-
from transformers import
|
35 |
from PIL import Image
|
36 |
import requests
|
37 |
|
38 |
url = 'http://images.cocodataset.org/val2017/000000039769.jpg'
|
39 |
image = Image.open(requests.get(url, stream=True).raw)
|
40 |
|
41 |
-
feature_extractor =
|
42 |
-
model = ViTHybridForImageClassification.from_pretrained('google/vit-base-
|
43 |
|
44 |
inputs = feature_extractor(images=image, return_tensors="pt")
|
45 |
outputs = model(**inputs)
|
|
|
31 |
Here is how to use this model to classify an image of the COCO 2017 dataset into one of the 1,000 ImageNet classes:
|
32 |
|
33 |
```python
|
34 |
+
from transformers import ViTHybridImageProcessor, ViTHybridForImageClassification
|
35 |
from PIL import Image
|
36 |
import requests
|
37 |
|
38 |
url = 'http://images.cocodataset.org/val2017/000000039769.jpg'
|
39 |
image = Image.open(requests.get(url, stream=True).raw)
|
40 |
|
41 |
+
feature_extractor = ViTHybridImageProcessor.from_pretrained('google/vit-hybrid-base-bit-384')
|
42 |
+
model = ViTHybridForImageClassification.from_pretrained('google/vit-hybrid-base-bit-384')
|
43 |
|
44 |
inputs = feature_extractor(images=image, return_tensors="pt")
|
45 |
outputs = model(**inputs)
|