akahana commited on
Commit
b7e917c
1 Parent(s): 2084769

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +17 -0
README.md CHANGED
@@ -33,6 +33,23 @@ It achieves the following results on the evaluation set:
33
  - Loss: 0.0369
34
  - Accuracy: 0.9883
35
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  ## Model description
37
 
38
  More information needed
 
33
  - Loss: 0.0369
34
  - Accuracy: 0.9883
35
 
36
+ ## how to use
37
+ ```python
38
+ from transformers import ViTFeatureExtractor, ViTModel
39
+ from PIL import Image
40
+ import requests
41
+
42
+ url = 'http://images.cocodataset.org/val2017/000000039769.jpg'
43
+ image = Image.open(requests.get(url, stream=True).raw)
44
+
45
+ feature_extractor = ViTFeatureExtractor.from_pretrained('google/vit-base-patch16-224-in21k')
46
+ model = ViTModel.from_pretrained('akahana/vit-base-cats-vs-dogs')
47
+ inputs = feature_extractor(images=image, return_tensors="pt")
48
+
49
+ outputs = model(**inputs)
50
+ last_hidden_states = outputs.last_hidden_state
51
+ ```
52
+
53
  ## Model description
54
 
55
  More information needed