echarlaix HF staff commited on
Commit
6dc21d1
1 Parent(s): 9f86bb5

Upload model

Browse files
README.md CHANGED
@@ -1,3 +1,28 @@
1
  ---
2
  license: apache-2.0
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: apache-2.0
3
+ datasets:
4
+ - food101
5
+ tags:
6
+ - openvino
7
+ - int8
8
  ---
9
+
10
+ ## [Vision Transformer (ViT)](https://huggingface.co/juliensimon/autotrain-food101-1471154050) quantized and exported to the OpenVINO IR.
11
+
12
+ ## Model Details
13
+ **Model Description:** This ViT model fine-tuned on Food-101 was statically quantized and exported to the OpenVINO IR using [optimum](https://huggingface.co/docs/optimum/intel/optimization_ov).
14
+
15
+ ## Usage example
16
+
17
+ You can use this model with Transformers *pipeline*.
18
+
19
+ ```python
20
+ from transformers import pipeline, AutoFeatureExtractor
21
+ from optimum.intel.openvino import OVModelForImageClassification
22
+
23
+ model_id = "echarlaix/vit-food101-int8"
24
+ model = OVModelForImageClassification.from_pretrained(model_id)
25
+ feature_extractor = AutoFeatureExtractor.from_pretrained(model_id)
26
+ pipe = pipeline("image-classification", model=model, feature_extractor=feature_extractor)
27
+ outputs = pipe("http://farm2.staticflickr.com/1375/1394861946_171ea43524_z.jpg")
28
+ ```
config.json ADDED
@@ -0,0 +1,232 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "juliensimon/autotrain-food101-1471154050",
3
+ "architectures": [
4
+ "ViTForImageClassification"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.0,
7
+ "encoder_stride": 16,
8
+ "hidden_act": "gelu",
9
+ "hidden_dropout_prob": 0.0,
10
+ "hidden_size": 768,
11
+ "id2label": {
12
+ "0": "apple_pie",
13
+ "1": "baby_back_ribs",
14
+ "2": "baklava",
15
+ "3": "beef_carpaccio",
16
+ "4": "beef_tartare",
17
+ "5": "beet_salad",
18
+ "6": "beignets",
19
+ "7": "bibimbap",
20
+ "8": "bread_pudding",
21
+ "9": "breakfast_burrito",
22
+ "10": "bruschetta",
23
+ "11": "caesar_salad",
24
+ "12": "cannoli",
25
+ "13": "caprese_salad",
26
+ "14": "carrot_cake",
27
+ "15": "ceviche",
28
+ "16": "cheese_plate",
29
+ "17": "cheesecake",
30
+ "18": "chicken_curry",
31
+ "19": "chicken_quesadilla",
32
+ "20": "chicken_wings",
33
+ "21": "chocolate_cake",
34
+ "22": "chocolate_mousse",
35
+ "23": "churros",
36
+ "24": "clam_chowder",
37
+ "25": "club_sandwich",
38
+ "26": "crab_cakes",
39
+ "27": "creme_brulee",
40
+ "28": "croque_madame",
41
+ "29": "cup_cakes",
42
+ "30": "deviled_eggs",
43
+ "31": "donuts",
44
+ "32": "dumplings",
45
+ "33": "edamame",
46
+ "34": "eggs_benedict",
47
+ "35": "escargots",
48
+ "36": "falafel",
49
+ "37": "filet_mignon",
50
+ "38": "fish_and_chips",
51
+ "39": "foie_gras",
52
+ "40": "french_fries",
53
+ "41": "french_onion_soup",
54
+ "42": "french_toast",
55
+ "43": "fried_calamari",
56
+ "44": "fried_rice",
57
+ "45": "frozen_yogurt",
58
+ "46": "garlic_bread",
59
+ "47": "gnocchi",
60
+ "48": "greek_salad",
61
+ "49": "grilled_cheese_sandwich",
62
+ "50": "grilled_salmon",
63
+ "51": "guacamole",
64
+ "52": "gyoza",
65
+ "53": "hamburger",
66
+ "54": "hot_and_sour_soup",
67
+ "55": "hot_dog",
68
+ "56": "huevos_rancheros",
69
+ "57": "hummus",
70
+ "58": "ice_cream",
71
+ "59": "lasagna",
72
+ "60": "lobster_bisque",
73
+ "61": "lobster_roll_sandwich",
74
+ "62": "macaroni_and_cheese",
75
+ "63": "macarons",
76
+ "64": "miso_soup",
77
+ "65": "mussels",
78
+ "66": "nachos",
79
+ "67": "omelette",
80
+ "68": "onion_rings",
81
+ "69": "oysters",
82
+ "70": "pad_thai",
83
+ "71": "paella",
84
+ "72": "pancakes",
85
+ "73": "panna_cotta",
86
+ "74": "peking_duck",
87
+ "75": "pho",
88
+ "76": "pizza",
89
+ "77": "pork_chop",
90
+ "78": "poutine",
91
+ "79": "prime_rib",
92
+ "80": "pulled_pork_sandwich",
93
+ "81": "ramen",
94
+ "82": "ravioli",
95
+ "83": "red_velvet_cake",
96
+ "84": "risotto",
97
+ "85": "samosa",
98
+ "86": "sashimi",
99
+ "87": "scallops",
100
+ "88": "seaweed_salad",
101
+ "89": "shrimp_and_grits",
102
+ "90": "spaghetti_bolognese",
103
+ "91": "spaghetti_carbonara",
104
+ "92": "spring_rolls",
105
+ "93": "steak",
106
+ "94": "strawberry_shortcake",
107
+ "95": "sushi",
108
+ "96": "tacos",
109
+ "97": "takoyaki",
110
+ "98": "tiramisu",
111
+ "99": "tuna_tartare",
112
+ "100": "waffles"
113
+ },
114
+ "image_size": 224,
115
+ "initializer_range": 0.02,
116
+ "intermediate_size": 3072,
117
+ "label2id": {
118
+ "apple_pie": "0",
119
+ "baby_back_ribs": "1",
120
+ "baklava": "2",
121
+ "beef_carpaccio": "3",
122
+ "beef_tartare": "4",
123
+ "beet_salad": "5",
124
+ "beignets": "6",
125
+ "bibimbap": "7",
126
+ "bread_pudding": "8",
127
+ "breakfast_burrito": "9",
128
+ "bruschetta": "10",
129
+ "caesar_salad": "11",
130
+ "cannoli": "12",
131
+ "caprese_salad": "13",
132
+ "carrot_cake": "14",
133
+ "ceviche": "15",
134
+ "cheese_plate": "16",
135
+ "cheesecake": "17",
136
+ "chicken_curry": "18",
137
+ "chicken_quesadilla": "19",
138
+ "chicken_wings": "20",
139
+ "chocolate_cake": "21",
140
+ "chocolate_mousse": "22",
141
+ "churros": "23",
142
+ "clam_chowder": "24",
143
+ "club_sandwich": "25",
144
+ "crab_cakes": "26",
145
+ "creme_brulee": "27",
146
+ "croque_madame": "28",
147
+ "cup_cakes": "29",
148
+ "deviled_eggs": "30",
149
+ "donuts": "31",
150
+ "dumplings": "32",
151
+ "edamame": "33",
152
+ "eggs_benedict": "34",
153
+ "escargots": "35",
154
+ "falafel": "36",
155
+ "filet_mignon": "37",
156
+ "fish_and_chips": "38",
157
+ "foie_gras": "39",
158
+ "french_fries": "40",
159
+ "french_onion_soup": "41",
160
+ "french_toast": "42",
161
+ "fried_calamari": "43",
162
+ "fried_rice": "44",
163
+ "frozen_yogurt": "45",
164
+ "garlic_bread": "46",
165
+ "gnocchi": "47",
166
+ "greek_salad": "48",
167
+ "grilled_cheese_sandwich": "49",
168
+ "grilled_salmon": "50",
169
+ "guacamole": "51",
170
+ "gyoza": "52",
171
+ "hamburger": "53",
172
+ "hot_and_sour_soup": "54",
173
+ "hot_dog": "55",
174
+ "huevos_rancheros": "56",
175
+ "hummus": "57",
176
+ "ice_cream": "58",
177
+ "lasagna": "59",
178
+ "lobster_bisque": "60",
179
+ "lobster_roll_sandwich": "61",
180
+ "macaroni_and_cheese": "62",
181
+ "macarons": "63",
182
+ "miso_soup": "64",
183
+ "mussels": "65",
184
+ "nachos": "66",
185
+ "omelette": "67",
186
+ "onion_rings": "68",
187
+ "oysters": "69",
188
+ "pad_thai": "70",
189
+ "paella": "71",
190
+ "pancakes": "72",
191
+ "panna_cotta": "73",
192
+ "peking_duck": "74",
193
+ "pho": "75",
194
+ "pizza": "76",
195
+ "pork_chop": "77",
196
+ "poutine": "78",
197
+ "prime_rib": "79",
198
+ "pulled_pork_sandwich": "80",
199
+ "ramen": "81",
200
+ "ravioli": "82",
201
+ "red_velvet_cake": "83",
202
+ "risotto": "84",
203
+ "samosa": "85",
204
+ "sashimi": "86",
205
+ "scallops": "87",
206
+ "seaweed_salad": "88",
207
+ "shrimp_and_grits": "89",
208
+ "spaghetti_bolognese": "90",
209
+ "spaghetti_carbonara": "91",
210
+ "spring_rolls": "92",
211
+ "steak": "93",
212
+ "strawberry_shortcake": "94",
213
+ "sushi": "95",
214
+ "tacos": "96",
215
+ "takoyaki": "97",
216
+ "tiramisu": "98",
217
+ "tuna_tartare": "99",
218
+ "waffles": "100"
219
+ },
220
+ "layer_norm_eps": 1e-12,
221
+ "max_length": 128,
222
+ "model_type": "vit",
223
+ "num_attention_heads": 12,
224
+ "num_channels": 3,
225
+ "num_hidden_layers": 12,
226
+ "padding": "max_length",
227
+ "patch_size": 16,
228
+ "problem_type": "single_label_classification",
229
+ "qkv_bias": true,
230
+ "torch_dtype": "float32",
231
+ "transformers_version": "4.23.1"
232
+ }
eval_results.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"accuracy": 0.8766336633663366, "total_time_in_seconds": 243.87956921099976, "samples_per_second": 20.70694161195127, "latency_in_seconds": 0.048292984002178165, "_timestamp": "2022-10-27T16:35:02.448899", "_git_commit_hash": "c0cefed96f8d3a0e9b39289a0f11b9ef60088f46", "_evaluate_version": "0.3.0", "_python_version": "3.8.13 (default, Oct 21 2022, 23:50:54) \n[GCC 11.2.0]", "_interpreter_path": "/home/ubuntu/miniconda3/envs/openvino_benchmark/bin/python"}
original_pytorch_model_eval_results.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"accuracy": 0.8762376237623762, "total_time_in_seconds": 471.4765717099999, "samples_per_second": 10.711030628063105, "latency_in_seconds": 0.09336169736831681, "_timestamp": "2022-10-27T16:42:54.766533", "_git_commit_hash": "c0cefed96f8d3a0e9b39289a0f11b9ef60088f46", "_evaluate_version": "0.3.0", "_python_version": "3.8.13 (default, Oct 21 2022, 23:50:54) \n[GCC 11.2.0]", "_interpreter_path": "/home/ubuntu/miniconda3/envs/openvino_benchmark/bin/python"}
ov_config.json ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "compression": {
3
+ "algorithm": "quantization",
4
+ "ignored_scopes": [
5
+ "{re}.*Embeddings.*",
6
+ "{re}.*__add___[0-1]",
7
+ "{re}.*layer_norm_0",
8
+ "{re}.*matmul_1",
9
+ "{re}.*__truediv__*"
10
+ ],
11
+ "initializer": {
12
+ "batchnorm_adaptation": {
13
+ "num_bn_adaptation_samples": 0
14
+ },
15
+ "range": {
16
+ "num_init_samples": 300,
17
+ "type": "mean_min_max"
18
+ }
19
+ },
20
+ "overflow_fix": "disable",
21
+ "preset": "mixed",
22
+ "scope_overrides": {
23
+ "activations": {
24
+ "{re}.*matmul_0": {
25
+ "mode": "symmetric"
26
+ }
27
+ }
28
+ }
29
+ },
30
+ "input_info": [
31
+ {
32
+ "keyword": "pixel_values",
33
+ "sample_size": [
34
+ 8,
35
+ 3,
36
+ 224,
37
+ 224
38
+ ],
39
+ "type": "float"
40
+ },
41
+ {
42
+ "keyword": "labels",
43
+ "sample_size": [
44
+ 8
45
+ ],
46
+ "type": "long"
47
+ }
48
+ ],
49
+ "optimum_version": "1.4.1",
50
+ "transformers_version": "4.23.1"
51
+ }
ov_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c21e8b661af575133ebb460d8ad3197c79364a5d6f23f0b756e662aa7aa88e8e
3
+ size 88801296
ov_model.xml ADDED
The diff for this file is too large to render. See raw diff
 
preprocessor_config.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "do_normalize": true,
3
+ "do_resize": true,
4
+ "feature_extractor_type": "ViTFeatureExtractor",
5
+ "image_mean": [
6
+ 0.5,
7
+ 0.5,
8
+ 0.5
9
+ ],
10
+ "image_std": [
11
+ 0.5,
12
+ 0.5,
13
+ 0.5
14
+ ],
15
+ "resample": 2,
16
+ "size": 224
17
+ }