Spaces:
Runtime error
Runtime error
feat: added train notebook
Browse files- train.ipynb +0 -0
- trainDogCat.ipynb +956 -0
train.ipynb
ADDED
The diff for this file is too large to render.
See raw diff
|
|
trainDogCat.ipynb
ADDED
@@ -0,0 +1,956 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
10 |
+
"name": "python3",
|
11 |
+
"display_name": "Python 3"
|
12 |
+
},
|
13 |
+
"language_info": {
|
14 |
+
"name": "python"
|
15 |
+
},
|
16 |
+
"accelerator": "GPU",
|
17 |
+
"gpuClass": "standard",
|
18 |
+
"widgets": {
|
19 |
+
"application/vnd.jupyter.widget-state+json": {
|
20 |
+
"03b5d8d7c0e342edaf1bf8c0dae84706": {
|
21 |
+
"model_module": "@jupyter-widgets/controls",
|
22 |
+
"model_name": "HBoxModel",
|
23 |
+
"model_module_version": "1.5.0",
|
24 |
+
"state": {
|
25 |
+
"_dom_classes": [],
|
26 |
+
"_model_module": "@jupyter-widgets/controls",
|
27 |
+
"_model_module_version": "1.5.0",
|
28 |
+
"_model_name": "HBoxModel",
|
29 |
+
"_view_count": null,
|
30 |
+
"_view_module": "@jupyter-widgets/controls",
|
31 |
+
"_view_module_version": "1.5.0",
|
32 |
+
"_view_name": "HBoxView",
|
33 |
+
"box_style": "",
|
34 |
+
"children": [
|
35 |
+
"IPY_MODEL_76d0f00d16204d5e807a1fdde62d2b9f",
|
36 |
+
"IPY_MODEL_85ce2407c68d478c88b238f77919ddd7",
|
37 |
+
"IPY_MODEL_245826af4628483bb74015f45c5e52cf"
|
38 |
+
],
|
39 |
+
"layout": "IPY_MODEL_4290384c4c8e4ba0929fcfd9c3183861"
|
40 |
+
}
|
41 |
+
},
|
42 |
+
"76d0f00d16204d5e807a1fdde62d2b9f": {
|
43 |
+
"model_module": "@jupyter-widgets/controls",
|
44 |
+
"model_name": "HTMLModel",
|
45 |
+
"model_module_version": "1.5.0",
|
46 |
+
"state": {
|
47 |
+
"_dom_classes": [],
|
48 |
+
"_model_module": "@jupyter-widgets/controls",
|
49 |
+
"_model_module_version": "1.5.0",
|
50 |
+
"_model_name": "HTMLModel",
|
51 |
+
"_view_count": null,
|
52 |
+
"_view_module": "@jupyter-widgets/controls",
|
53 |
+
"_view_module_version": "1.5.0",
|
54 |
+
"_view_name": "HTMLView",
|
55 |
+
"description": "",
|
56 |
+
"description_tooltip": null,
|
57 |
+
"layout": "IPY_MODEL_6139fd52cac140289bc2f3dfdeb28003",
|
58 |
+
"placeholder": "",
|
59 |
+
"style": "IPY_MODEL_3c08c26d91574ca1ae9d9738fc0294e0",
|
60 |
+
"value": "100%"
|
61 |
+
}
|
62 |
+
},
|
63 |
+
"85ce2407c68d478c88b238f77919ddd7": {
|
64 |
+
"model_module": "@jupyter-widgets/controls",
|
65 |
+
"model_name": "FloatProgressModel",
|
66 |
+
"model_module_version": "1.5.0",
|
67 |
+
"state": {
|
68 |
+
"_dom_classes": [],
|
69 |
+
"_model_module": "@jupyter-widgets/controls",
|
70 |
+
"_model_module_version": "1.5.0",
|
71 |
+
"_model_name": "FloatProgressModel",
|
72 |
+
"_view_count": null,
|
73 |
+
"_view_module": "@jupyter-widgets/controls",
|
74 |
+
"_view_module_version": "1.5.0",
|
75 |
+
"_view_name": "ProgressView",
|
76 |
+
"bar_style": "success",
|
77 |
+
"description": "",
|
78 |
+
"description_tooltip": null,
|
79 |
+
"layout": "IPY_MODEL_1cf6d579c80a481d87ca48651bf14aed",
|
80 |
+
"max": 46830571,
|
81 |
+
"min": 0,
|
82 |
+
"orientation": "horizontal",
|
83 |
+
"style": "IPY_MODEL_d7916a66c6c74f38a78ac8ae5b45521a",
|
84 |
+
"value": 46830571
|
85 |
+
}
|
86 |
+
},
|
87 |
+
"245826af4628483bb74015f45c5e52cf": {
|
88 |
+
"model_module": "@jupyter-widgets/controls",
|
89 |
+
"model_name": "HTMLModel",
|
90 |
+
"model_module_version": "1.5.0",
|
91 |
+
"state": {
|
92 |
+
"_dom_classes": [],
|
93 |
+
"_model_module": "@jupyter-widgets/controls",
|
94 |
+
"_model_module_version": "1.5.0",
|
95 |
+
"_model_name": "HTMLModel",
|
96 |
+
"_view_count": null,
|
97 |
+
"_view_module": "@jupyter-widgets/controls",
|
98 |
+
"_view_module_version": "1.5.0",
|
99 |
+
"_view_name": "HTMLView",
|
100 |
+
"description": "",
|
101 |
+
"description_tooltip": null,
|
102 |
+
"layout": "IPY_MODEL_81f3a190007c4d099b6c8973aaaa7023",
|
103 |
+
"placeholder": "",
|
104 |
+
"style": "IPY_MODEL_334cea03105d4886ac4e689c907dd543",
|
105 |
+
"value": " 44.7M/44.7M [00:01<00:00, 31.3MB/s]"
|
106 |
+
}
|
107 |
+
},
|
108 |
+
"4290384c4c8e4ba0929fcfd9c3183861": {
|
109 |
+
"model_module": "@jupyter-widgets/base",
|
110 |
+
"model_name": "LayoutModel",
|
111 |
+
"model_module_version": "1.2.0",
|
112 |
+
"state": {
|
113 |
+
"_model_module": "@jupyter-widgets/base",
|
114 |
+
"_model_module_version": "1.2.0",
|
115 |
+
"_model_name": "LayoutModel",
|
116 |
+
"_view_count": null,
|
117 |
+
"_view_module": "@jupyter-widgets/base",
|
118 |
+
"_view_module_version": "1.2.0",
|
119 |
+
"_view_name": "LayoutView",
|
120 |
+
"align_content": null,
|
121 |
+
"align_items": null,
|
122 |
+
"align_self": null,
|
123 |
+
"border": null,
|
124 |
+
"bottom": null,
|
125 |
+
"display": null,
|
126 |
+
"flex": null,
|
127 |
+
"flex_flow": null,
|
128 |
+
"grid_area": null,
|
129 |
+
"grid_auto_columns": null,
|
130 |
+
"grid_auto_flow": null,
|
131 |
+
"grid_auto_rows": null,
|
132 |
+
"grid_column": null,
|
133 |
+
"grid_gap": null,
|
134 |
+
"grid_row": null,
|
135 |
+
"grid_template_areas": null,
|
136 |
+
"grid_template_columns": null,
|
137 |
+
"grid_template_rows": null,
|
138 |
+
"height": null,
|
139 |
+
"justify_content": null,
|
140 |
+
"justify_items": null,
|
141 |
+
"left": null,
|
142 |
+
"margin": null,
|
143 |
+
"max_height": null,
|
144 |
+
"max_width": null,
|
145 |
+
"min_height": null,
|
146 |
+
"min_width": null,
|
147 |
+
"object_fit": null,
|
148 |
+
"object_position": null,
|
149 |
+
"order": null,
|
150 |
+
"overflow": null,
|
151 |
+
"overflow_x": null,
|
152 |
+
"overflow_y": null,
|
153 |
+
"padding": null,
|
154 |
+
"right": null,
|
155 |
+
"top": null,
|
156 |
+
"visibility": null,
|
157 |
+
"width": null
|
158 |
+
}
|
159 |
+
},
|
160 |
+
"6139fd52cac140289bc2f3dfdeb28003": {
|
161 |
+
"model_module": "@jupyter-widgets/base",
|
162 |
+
"model_name": "LayoutModel",
|
163 |
+
"model_module_version": "1.2.0",
|
164 |
+
"state": {
|
165 |
+
"_model_module": "@jupyter-widgets/base",
|
166 |
+
"_model_module_version": "1.2.0",
|
167 |
+
"_model_name": "LayoutModel",
|
168 |
+
"_view_count": null,
|
169 |
+
"_view_module": "@jupyter-widgets/base",
|
170 |
+
"_view_module_version": "1.2.0",
|
171 |
+
"_view_name": "LayoutView",
|
172 |
+
"align_content": null,
|
173 |
+
"align_items": null,
|
174 |
+
"align_self": null,
|
175 |
+
"border": null,
|
176 |
+
"bottom": null,
|
177 |
+
"display": null,
|
178 |
+
"flex": null,
|
179 |
+
"flex_flow": null,
|
180 |
+
"grid_area": null,
|
181 |
+
"grid_auto_columns": null,
|
182 |
+
"grid_auto_flow": null,
|
183 |
+
"grid_auto_rows": null,
|
184 |
+
"grid_column": null,
|
185 |
+
"grid_gap": null,
|
186 |
+
"grid_row": null,
|
187 |
+
"grid_template_areas": null,
|
188 |
+
"grid_template_columns": null,
|
189 |
+
"grid_template_rows": null,
|
190 |
+
"height": null,
|
191 |
+
"justify_content": null,
|
192 |
+
"justify_items": null,
|
193 |
+
"left": null,
|
194 |
+
"margin": null,
|
195 |
+
"max_height": null,
|
196 |
+
"max_width": null,
|
197 |
+
"min_height": null,
|
198 |
+
"min_width": null,
|
199 |
+
"object_fit": null,
|
200 |
+
"object_position": null,
|
201 |
+
"order": null,
|
202 |
+
"overflow": null,
|
203 |
+
"overflow_x": null,
|
204 |
+
"overflow_y": null,
|
205 |
+
"padding": null,
|
206 |
+
"right": null,
|
207 |
+
"top": null,
|
208 |
+
"visibility": null,
|
209 |
+
"width": null
|
210 |
+
}
|
211 |
+
},
|
212 |
+
"3c08c26d91574ca1ae9d9738fc0294e0": {
|
213 |
+
"model_module": "@jupyter-widgets/controls",
|
214 |
+
"model_name": "DescriptionStyleModel",
|
215 |
+
"model_module_version": "1.5.0",
|
216 |
+
"state": {
|
217 |
+
"_model_module": "@jupyter-widgets/controls",
|
218 |
+
"_model_module_version": "1.5.0",
|
219 |
+
"_model_name": "DescriptionStyleModel",
|
220 |
+
"_view_count": null,
|
221 |
+
"_view_module": "@jupyter-widgets/base",
|
222 |
+
"_view_module_version": "1.2.0",
|
223 |
+
"_view_name": "StyleView",
|
224 |
+
"description_width": ""
|
225 |
+
}
|
226 |
+
},
|
227 |
+
"1cf6d579c80a481d87ca48651bf14aed": {
|
228 |
+
"model_module": "@jupyter-widgets/base",
|
229 |
+
"model_name": "LayoutModel",
|
230 |
+
"model_module_version": "1.2.0",
|
231 |
+
"state": {
|
232 |
+
"_model_module": "@jupyter-widgets/base",
|
233 |
+
"_model_module_version": "1.2.0",
|
234 |
+
"_model_name": "LayoutModel",
|
235 |
+
"_view_count": null,
|
236 |
+
"_view_module": "@jupyter-widgets/base",
|
237 |
+
"_view_module_version": "1.2.0",
|
238 |
+
"_view_name": "LayoutView",
|
239 |
+
"align_content": null,
|
240 |
+
"align_items": null,
|
241 |
+
"align_self": null,
|
242 |
+
"border": null,
|
243 |
+
"bottom": null,
|
244 |
+
"display": null,
|
245 |
+
"flex": null,
|
246 |
+
"flex_flow": null,
|
247 |
+
"grid_area": null,
|
248 |
+
"grid_auto_columns": null,
|
249 |
+
"grid_auto_flow": null,
|
250 |
+
"grid_auto_rows": null,
|
251 |
+
"grid_column": null,
|
252 |
+
"grid_gap": null,
|
253 |
+
"grid_row": null,
|
254 |
+
"grid_template_areas": null,
|
255 |
+
"grid_template_columns": null,
|
256 |
+
"grid_template_rows": null,
|
257 |
+
"height": null,
|
258 |
+
"justify_content": null,
|
259 |
+
"justify_items": null,
|
260 |
+
"left": null,
|
261 |
+
"margin": null,
|
262 |
+
"max_height": null,
|
263 |
+
"max_width": null,
|
264 |
+
"min_height": null,
|
265 |
+
"min_width": null,
|
266 |
+
"object_fit": null,
|
267 |
+
"object_position": null,
|
268 |
+
"order": null,
|
269 |
+
"overflow": null,
|
270 |
+
"overflow_x": null,
|
271 |
+
"overflow_y": null,
|
272 |
+
"padding": null,
|
273 |
+
"right": null,
|
274 |
+
"top": null,
|
275 |
+
"visibility": null,
|
276 |
+
"width": null
|
277 |
+
}
|
278 |
+
},
|
279 |
+
"d7916a66c6c74f38a78ac8ae5b45521a": {
|
280 |
+
"model_module": "@jupyter-widgets/controls",
|
281 |
+
"model_name": "ProgressStyleModel",
|
282 |
+
"model_module_version": "1.5.0",
|
283 |
+
"state": {
|
284 |
+
"_model_module": "@jupyter-widgets/controls",
|
285 |
+
"_model_module_version": "1.5.0",
|
286 |
+
"_model_name": "ProgressStyleModel",
|
287 |
+
"_view_count": null,
|
288 |
+
"_view_module": "@jupyter-widgets/base",
|
289 |
+
"_view_module_version": "1.2.0",
|
290 |
+
"_view_name": "StyleView",
|
291 |
+
"bar_color": null,
|
292 |
+
"description_width": ""
|
293 |
+
}
|
294 |
+
},
|
295 |
+
"81f3a190007c4d099b6c8973aaaa7023": {
|
296 |
+
"model_module": "@jupyter-widgets/base",
|
297 |
+
"model_name": "LayoutModel",
|
298 |
+
"model_module_version": "1.2.0",
|
299 |
+
"state": {
|
300 |
+
"_model_module": "@jupyter-widgets/base",
|
301 |
+
"_model_module_version": "1.2.0",
|
302 |
+
"_model_name": "LayoutModel",
|
303 |
+
"_view_count": null,
|
304 |
+
"_view_module": "@jupyter-widgets/base",
|
305 |
+
"_view_module_version": "1.2.0",
|
306 |
+
"_view_name": "LayoutView",
|
307 |
+
"align_content": null,
|
308 |
+
"align_items": null,
|
309 |
+
"align_self": null,
|
310 |
+
"border": null,
|
311 |
+
"bottom": null,
|
312 |
+
"display": null,
|
313 |
+
"flex": null,
|
314 |
+
"flex_flow": null,
|
315 |
+
"grid_area": null,
|
316 |
+
"grid_auto_columns": null,
|
317 |
+
"grid_auto_flow": null,
|
318 |
+
"grid_auto_rows": null,
|
319 |
+
"grid_column": null,
|
320 |
+
"grid_gap": null,
|
321 |
+
"grid_row": null,
|
322 |
+
"grid_template_areas": null,
|
323 |
+
"grid_template_columns": null,
|
324 |
+
"grid_template_rows": null,
|
325 |
+
"height": null,
|
326 |
+
"justify_content": null,
|
327 |
+
"justify_items": null,
|
328 |
+
"left": null,
|
329 |
+
"margin": null,
|
330 |
+
"max_height": null,
|
331 |
+
"max_width": null,
|
332 |
+
"min_height": null,
|
333 |
+
"min_width": null,
|
334 |
+
"object_fit": null,
|
335 |
+
"object_position": null,
|
336 |
+
"order": null,
|
337 |
+
"overflow": null,
|
338 |
+
"overflow_x": null,
|
339 |
+
"overflow_y": null,
|
340 |
+
"padding": null,
|
341 |
+
"right": null,
|
342 |
+
"top": null,
|
343 |
+
"visibility": null,
|
344 |
+
"width": null
|
345 |
+
}
|
346 |
+
},
|
347 |
+
"334cea03105d4886ac4e689c907dd543": {
|
348 |
+
"model_module": "@jupyter-widgets/controls",
|
349 |
+
"model_name": "DescriptionStyleModel",
|
350 |
+
"model_module_version": "1.5.0",
|
351 |
+
"state": {
|
352 |
+
"_model_module": "@jupyter-widgets/controls",
|
353 |
+
"_model_module_version": "1.5.0",
|
354 |
+
"_model_name": "DescriptionStyleModel",
|
355 |
+
"_view_count": null,
|
356 |
+
"_view_module": "@jupyter-widgets/base",
|
357 |
+
"_view_module_version": "1.2.0",
|
358 |
+
"_view_name": "StyleView",
|
359 |
+
"description_width": ""
|
360 |
+
}
|
361 |
+
}
|
362 |
+
}
|
363 |
+
}
|
364 |
+
},
|
365 |
+
"cells": [
|
366 |
+
{
|
367 |
+
"cell_type": "markdown",
|
368 |
+
"source": [
|
369 |
+
"## GPU Check"
|
370 |
+
],
|
371 |
+
"metadata": {
|
372 |
+
"id": "abRNUshGkERl"
|
373 |
+
}
|
374 |
+
},
|
375 |
+
{
|
376 |
+
"cell_type": "code",
|
377 |
+
"source": [
|
378 |
+
"gpu_info = !nvidia-smi\n",
|
379 |
+
"gpu_info = '\\n'.join(gpu_info)\n",
|
380 |
+
"if gpu_info.find('failed') >= 0:\n",
|
381 |
+
" print('Not connected to a GPU')\n",
|
382 |
+
"else:\n",
|
383 |
+
" print(gpu_info)"
|
384 |
+
],
|
385 |
+
"metadata": {
|
386 |
+
"colab": {
|
387 |
+
"base_uri": "https://localhost:8080/"
|
388 |
+
},
|
389 |
+
"id": "Bj3utd9hhu6h",
|
390 |
+
"outputId": "3894d68e-f235-4dd6-e837-41139675fe5a"
|
391 |
+
},
|
392 |
+
"execution_count": 1,
|
393 |
+
"outputs": [
|
394 |
+
{
|
395 |
+
"output_type": "stream",
|
396 |
+
"name": "stdout",
|
397 |
+
"text": [
|
398 |
+
"Sat Oct 29 16:15:38 2022 \n",
|
399 |
+
"+-----------------------------------------------------------------------------+\n",
|
400 |
+
"| NVIDIA-SMI 460.32.03 Driver Version: 460.32.03 CUDA Version: 11.2 |\n",
|
401 |
+
"|-------------------------------+----------------------+----------------------+\n",
|
402 |
+
"| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |\n",
|
403 |
+
"| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |\n",
|
404 |
+
"| | | MIG M. |\n",
|
405 |
+
"|===============================+======================+======================|\n",
|
406 |
+
"| 0 Tesla T4 Off | 00000000:00:04.0 Off | 0 |\n",
|
407 |
+
"| N/A 60C P8 10W / 70W | 0MiB / 15109MiB | 0% Default |\n",
|
408 |
+
"| | | N/A |\n",
|
409 |
+
"+-------------------------------+----------------------+----------------------+\n",
|
410 |
+
" \n",
|
411 |
+
"+-----------------------------------------------------------------------------+\n",
|
412 |
+
"| Processes: |\n",
|
413 |
+
"| GPU GI CI PID Type Process name GPU Memory |\n",
|
414 |
+
"| ID ID Usage |\n",
|
415 |
+
"|=============================================================================|\n",
|
416 |
+
"| No running processes found |\n",
|
417 |
+
"+-----------------------------------------------------------------------------+\n"
|
418 |
+
]
|
419 |
+
}
|
420 |
+
]
|
421 |
+
},
|
422 |
+
{
|
423 |
+
"cell_type": "markdown",
|
424 |
+
"source": [
|
425 |
+
"## Install Gradio"
|
426 |
+
],
|
427 |
+
"metadata": {
|
428 |
+
"id": "7onhw0j5kJbd"
|
429 |
+
}
|
430 |
+
},
|
431 |
+
{
|
432 |
+
"cell_type": "code",
|
433 |
+
"source": [
|
434 |
+
"! pip install gradio"
|
435 |
+
],
|
436 |
+
"metadata": {
|
437 |
+
"colab": {
|
438 |
+
"base_uri": "https://localhost:8080/"
|
439 |
+
},
|
440 |
+
"id": "1Pf-ER3Uiv9l",
|
441 |
+
"outputId": "fe730240-d327-4d78-b80e-7f2f77feed73"
|
442 |
+
},
|
443 |
+
"execution_count": 7,
|
444 |
+
"outputs": [
|
445 |
+
{
|
446 |
+
"output_type": "stream",
|
447 |
+
"name": "stdout",
|
448 |
+
"text": [
|
449 |
+
"Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n",
|
450 |
+
"Collecting gradio\n",
|
451 |
+
" Downloading gradio-3.8-py3-none-any.whl (11.6 MB)\n",
|
452 |
+
"\u001b[K |████████████████████████████████| 11.6 MB 13.9 MB/s \n",
|
453 |
+
"\u001b[?25hCollecting pydub\n",
|
454 |
+
" Downloading pydub-0.25.1-py2.py3-none-any.whl (32 kB)\n",
|
455 |
+
"Collecting paramiko\n",
|
456 |
+
" Downloading paramiko-2.11.0-py2.py3-none-any.whl (212 kB)\n",
|
457 |
+
"\u001b[K |████████████████████████████████| 212 kB 62.2 MB/s \n",
|
458 |
+
"\u001b[?25hRequirement already satisfied: pillow in /usr/local/lib/python3.7/dist-packages (from gradio) (7.1.2)\n",
|
459 |
+
"Requirement already satisfied: pydantic in /usr/local/lib/python3.7/dist-packages (from gradio) (1.10.2)\n",
|
460 |
+
"Collecting h11<0.13,>=0.11\n",
|
461 |
+
" Downloading h11-0.12.0-py3-none-any.whl (54 kB)\n",
|
462 |
+
"\u001b[K |████████████████████████████████| 54 kB 4.0 MB/s \n",
|
463 |
+
"\u001b[?25hRequirement already satisfied: jinja2 in /usr/local/lib/python3.7/dist-packages (from gradio) (2.11.3)\n",
|
464 |
+
"Collecting httpx\n",
|
465 |
+
" Downloading httpx-0.23.0-py3-none-any.whl (84 kB)\n",
|
466 |
+
"\u001b[K |████████████████████████████████| 84 kB 3.9 MB/s \n",
|
467 |
+
"\u001b[?25hCollecting websockets\n",
|
468 |
+
" Downloading websockets-10.4-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (106 kB)\n",
|
469 |
+
"\u001b[K |████████████████████████████████| 106 kB 67.4 MB/s \n",
|
470 |
+
"\u001b[?25hRequirement already satisfied: aiohttp in /usr/local/lib/python3.7/dist-packages (from gradio) (3.8.3)\n",
|
471 |
+
"Requirement already satisfied: matplotlib in /usr/local/lib/python3.7/dist-packages (from gradio) (3.2.2)\n",
|
472 |
+
"Requirement already satisfied: pandas in /usr/local/lib/python3.7/dist-packages (from gradio) (1.3.5)\n",
|
473 |
+
"Collecting uvicorn\n",
|
474 |
+
" Downloading uvicorn-0.19.0-py3-none-any.whl (56 kB)\n",
|
475 |
+
"\u001b[K |████████████████████████████████| 56 kB 5.5 MB/s \n",
|
476 |
+
"\u001b[?25hRequirement already satisfied: pyyaml in /usr/local/lib/python3.7/dist-packages (from gradio) (6.0)\n",
|
477 |
+
"Requirement already satisfied: numpy in /usr/local/lib/python3.7/dist-packages (from gradio) (1.21.6)\n",
|
478 |
+
"Collecting fastapi\n",
|
479 |
+
" Downloading fastapi-0.85.1-py3-none-any.whl (55 kB)\n",
|
480 |
+
"\u001b[K |████████████████████████████████| 55 kB 4.0 MB/s \n",
|
481 |
+
"\u001b[?25hCollecting ffmpy\n",
|
482 |
+
" Downloading ffmpy-0.3.0.tar.gz (4.8 kB)\n",
|
483 |
+
"Collecting python-multipart\n",
|
484 |
+
" Downloading python-multipart-0.0.5.tar.gz (32 kB)\n",
|
485 |
+
"Requirement already satisfied: fsspec in /usr/local/lib/python3.7/dist-packages (from gradio) (2022.10.0)\n",
|
486 |
+
"Collecting pycryptodome\n",
|
487 |
+
" Downloading pycryptodome-3.15.0-cp35-abi3-manylinux2010_x86_64.whl (2.3 MB)\n",
|
488 |
+
"\u001b[K |████████████████████████████████| 2.3 MB 49.5 MB/s \n",
|
489 |
+
"\u001b[?25hCollecting markdown-it-py[linkify,plugins]\n",
|
490 |
+
" Downloading markdown_it_py-2.1.0-py3-none-any.whl (84 kB)\n",
|
491 |
+
"\u001b[K |████████████████████████████████| 84 kB 3.6 MB/s \n",
|
492 |
+
"\u001b[?25hRequirement already satisfied: requests in /usr/local/lib/python3.7/dist-packages (from gradio) (2.23.0)\n",
|
493 |
+
"Collecting orjson\n",
|
494 |
+
" Downloading orjson-3.8.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (272 kB)\n",
|
495 |
+
"\u001b[K |████████████████████████████████| 272 kB 67.4 MB/s \n",
|
496 |
+
"\u001b[?25hRequirement already satisfied: charset-normalizer<3.0,>=2.0 in /usr/local/lib/python3.7/dist-packages (from aiohttp->gradio) (2.1.1)\n",
|
497 |
+
"Requirement already satisfied: asynctest==0.13.0 in /usr/local/lib/python3.7/dist-packages (from aiohttp->gradio) (0.13.0)\n",
|
498 |
+
"Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in /usr/local/lib/python3.7/dist-packages (from aiohttp->gradio) (4.0.2)\n",
|
499 |
+
"Requirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.7/dist-packages (from aiohttp->gradio) (22.1.0)\n",
|
500 |
+
"Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib/python3.7/dist-packages (from aiohttp->gradio) (6.0.2)\n",
|
501 |
+
"Requirement already satisfied: yarl<2.0,>=1.0 in /usr/local/lib/python3.7/dist-packages (from aiohttp->gradio) (1.8.1)\n",
|
502 |
+
"Requirement already satisfied: aiosignal>=1.1.2 in /usr/local/lib/python3.7/dist-packages (from aiohttp->gradio) (1.2.0)\n",
|
503 |
+
"Requirement already satisfied: typing-extensions>=3.7.4 in /usr/local/lib/python3.7/dist-packages (from aiohttp->gradio) (4.1.1)\n",
|
504 |
+
"Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.7/dist-packages (from aiohttp->gradio) (1.3.1)\n",
|
505 |
+
"Requirement already satisfied: idna>=2.0 in /usr/local/lib/python3.7/dist-packages (from yarl<2.0,>=1.0->aiohttp->gradio) (2.10)\n",
|
506 |
+
"Collecting starlette==0.20.4\n",
|
507 |
+
" Downloading starlette-0.20.4-py3-none-any.whl (63 kB)\n",
|
508 |
+
"\u001b[K |████████████████████████████████| 63 kB 2.4 MB/s \n",
|
509 |
+
"\u001b[?25hCollecting anyio<5,>=3.4.0\n",
|
510 |
+
" Downloading anyio-3.6.2-py3-none-any.whl (80 kB)\n",
|
511 |
+
"\u001b[K |████████████████████████████████| 80 kB 10.2 MB/s \n",
|
512 |
+
"\u001b[?25hCollecting sniffio>=1.1\n",
|
513 |
+
" Downloading sniffio-1.3.0-py3-none-any.whl (10 kB)\n",
|
514 |
+
"Collecting rfc3986[idna2008]<2,>=1.3\n",
|
515 |
+
" Downloading rfc3986-1.5.0-py2.py3-none-any.whl (31 kB)\n",
|
516 |
+
"Requirement already satisfied: certifi in /usr/local/lib/python3.7/dist-packages (from httpx->gradio) (2022.9.24)\n",
|
517 |
+
"Collecting httpcore<0.16.0,>=0.15.0\n",
|
518 |
+
" Downloading httpcore-0.15.0-py3-none-any.whl (68 kB)\n",
|
519 |
+
"\u001b[K |████████████████████████████████| 68 kB 7.0 MB/s \n",
|
520 |
+
"\u001b[?25hRequirement already satisfied: MarkupSafe>=0.23 in /usr/local/lib/python3.7/dist-packages (from jinja2->gradio) (2.0.1)\n",
|
521 |
+
"Collecting mdurl~=0.1\n",
|
522 |
+
" Downloading mdurl-0.1.2-py3-none-any.whl (10.0 kB)\n",
|
523 |
+
"Collecting mdit-py-plugins\n",
|
524 |
+
" Downloading mdit_py_plugins-0.3.1-py3-none-any.whl (46 kB)\n",
|
525 |
+
"\u001b[K |████████████████████████████████| 46 kB 4.4 MB/s \n",
|
526 |
+
"\u001b[?25hCollecting linkify-it-py~=1.0\n",
|
527 |
+
" Downloading linkify_it_py-1.0.3-py3-none-any.whl (19 kB)\n",
|
528 |
+
"Collecting uc-micro-py\n",
|
529 |
+
" Downloading uc_micro_py-1.0.1-py3-none-any.whl (6.2 kB)\n",
|
530 |
+
"Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib->gradio) (1.4.4)\n",
|
531 |
+
"Requirement already satisfied: python-dateutil>=2.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib->gradio) (2.8.2)\n",
|
532 |
+
"Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib->gradio) (3.0.9)\n",
|
533 |
+
"Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.7/dist-packages (from matplotlib->gradio) (0.11.0)\n",
|
534 |
+
"Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.7/dist-packages (from python-dateutil>=2.1->matplotlib->gradio) (1.15.0)\n",
|
535 |
+
"Requirement already satisfied: pytz>=2017.3 in /usr/local/lib/python3.7/dist-packages (from pandas->gradio) (2022.5)\n",
|
536 |
+
"Collecting bcrypt>=3.1.3\n",
|
537 |
+
" Downloading bcrypt-4.0.1-cp36-abi3-manylinux_2_24_x86_64.whl (593 kB)\n",
|
538 |
+
"\u001b[K |████████████████████████████��███| 593 kB 63.1 MB/s \n",
|
539 |
+
"\u001b[?25hCollecting cryptography>=2.5\n",
|
540 |
+
" Downloading cryptography-38.0.1-cp36-abi3-manylinux_2_24_x86_64.whl (4.0 MB)\n",
|
541 |
+
"\u001b[K |████████████████████████████████| 4.0 MB 50.5 MB/s \n",
|
542 |
+
"\u001b[?25hCollecting pynacl>=1.0.1\n",
|
543 |
+
" Downloading PyNaCl-1.5.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (856 kB)\n",
|
544 |
+
"\u001b[K |████████████████████████████████| 856 kB 59.6 MB/s \n",
|
545 |
+
"\u001b[?25hRequirement already satisfied: cffi>=1.12 in /usr/local/lib/python3.7/dist-packages (from cryptography>=2.5->paramiko->gradio) (1.15.1)\n",
|
546 |
+
"Requirement already satisfied: pycparser in /usr/local/lib/python3.7/dist-packages (from cffi>=1.12->cryptography>=2.5->paramiko->gradio) (2.21)\n",
|
547 |
+
"Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python3.7/dist-packages (from requests->gradio) (1.24.3)\n",
|
548 |
+
"Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.7/dist-packages (from requests->gradio) (3.0.4)\n",
|
549 |
+
"Requirement already satisfied: click>=7.0 in /usr/local/lib/python3.7/dist-packages (from uvicorn->gradio) (7.1.2)\n",
|
550 |
+
"Building wheels for collected packages: ffmpy, python-multipart\n",
|
551 |
+
" Building wheel for ffmpy (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
|
552 |
+
" Created wheel for ffmpy: filename=ffmpy-0.3.0-py3-none-any.whl size=4712 sha256=30a69bb5c2b13d3f226683651d6c7e566842a49c9e840811e091e85f33d3cb6d\n",
|
553 |
+
" Stored in directory: /root/.cache/pip/wheels/13/e4/6c/e8059816e86796a597c6e6b0d4c880630f51a1fcfa0befd5e6\n",
|
554 |
+
" Building wheel for python-multipart (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
|
555 |
+
" Created wheel for python-multipart: filename=python_multipart-0.0.5-py3-none-any.whl size=31678 sha256=9cc4b9d0bfff456225d6cd5b036cc098475e4d97b6e6cf941c0552a6fc62ad0c\n",
|
556 |
+
" Stored in directory: /root/.cache/pip/wheels/2c/41/7c/bfd1c180534ffdcc0972f78c5758f89881602175d48a8bcd2c\n",
|
557 |
+
"Successfully built ffmpy python-multipart\n",
|
558 |
+
"Installing collected packages: sniffio, mdurl, uc-micro-py, rfc3986, markdown-it-py, h11, anyio, starlette, pynacl, mdit-py-plugins, linkify-it-py, httpcore, cryptography, bcrypt, websockets, uvicorn, python-multipart, pydub, pycryptodome, paramiko, orjson, httpx, ffmpy, fastapi, gradio\n",
|
559 |
+
"Successfully installed anyio-3.6.2 bcrypt-4.0.1 cryptography-38.0.1 fastapi-0.85.1 ffmpy-0.3.0 gradio-3.8 h11-0.12.0 httpcore-0.15.0 httpx-0.23.0 linkify-it-py-1.0.3 markdown-it-py-2.1.0 mdit-py-plugins-0.3.1 mdurl-0.1.2 orjson-3.8.1 paramiko-2.11.0 pycryptodome-3.15.0 pydub-0.25.1 pynacl-1.5.0 python-multipart-0.0.5 rfc3986-1.5.0 sniffio-1.3.0 starlette-0.20.4 uc-micro-py-1.0.1 uvicorn-0.19.0 websockets-10.4\n"
|
560 |
+
]
|
561 |
+
}
|
562 |
+
]
|
563 |
+
},
|
564 |
+
{
|
565 |
+
"cell_type": "markdown",
|
566 |
+
"source": [
|
567 |
+
"## Aggregate, process, clean, label, and version data"
|
568 |
+
],
|
569 |
+
"metadata": {
|
570 |
+
"id": "6PtjDSNMk39S"
|
571 |
+
}
|
572 |
+
},
|
573 |
+
{
|
574 |
+
"cell_type": "code",
|
575 |
+
"execution_count": 2,
|
576 |
+
"metadata": {
|
577 |
+
"colab": {
|
578 |
+
"base_uri": "https://localhost:8080/",
|
579 |
+
"height": 303,
|
580 |
+
"referenced_widgets": [
|
581 |
+
"03b5d8d7c0e342edaf1bf8c0dae84706",
|
582 |
+
"76d0f00d16204d5e807a1fdde62d2b9f",
|
583 |
+
"85ce2407c68d478c88b238f77919ddd7",
|
584 |
+
"245826af4628483bb74015f45c5e52cf",
|
585 |
+
"4290384c4c8e4ba0929fcfd9c3183861",
|
586 |
+
"6139fd52cac140289bc2f3dfdeb28003",
|
587 |
+
"3c08c26d91574ca1ae9d9738fc0294e0",
|
588 |
+
"1cf6d579c80a481d87ca48651bf14aed",
|
589 |
+
"d7916a66c6c74f38a78ac8ae5b45521a",
|
590 |
+
"81f3a190007c4d099b6c8973aaaa7023",
|
591 |
+
"334cea03105d4886ac4e689c907dd543"
|
592 |
+
]
|
593 |
+
},
|
594 |
+
"id": "FD1OBFNshXD3",
|
595 |
+
"outputId": "aca8824c-aac5-4e49-910c-1da414b3fe27"
|
596 |
+
},
|
597 |
+
"outputs": [
|
598 |
+
{
|
599 |
+
"output_type": "display_data",
|
600 |
+
"data": {
|
601 |
+
"text/plain": [
|
602 |
+
"<IPython.core.display.HTML object>"
|
603 |
+
],
|
604 |
+
"text/html": [
|
605 |
+
"\n",
|
606 |
+
"<style>\n",
|
607 |
+
" /* Turns off some styling */\n",
|
608 |
+
" progress {\n",
|
609 |
+
" /* gets rid of default border in Firefox and Opera. */\n",
|
610 |
+
" border: none;\n",
|
611 |
+
" /* Needs to be in here for Safari polyfill so background images work as expected. */\n",
|
612 |
+
" background-size: auto;\n",
|
613 |
+
" }\n",
|
614 |
+
" progress:not([value]), progress:not([value])::-webkit-progress-bar {\n",
|
615 |
+
" background: repeating-linear-gradient(45deg, #7e7e7e, #7e7e7e 10px, #5c5c5c 10px, #5c5c5c 20px);\n",
|
616 |
+
" }\n",
|
617 |
+
" .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n",
|
618 |
+
" background: #F44336;\n",
|
619 |
+
" }\n",
|
620 |
+
"</style>\n"
|
621 |
+
]
|
622 |
+
},
|
623 |
+
"metadata": {}
|
624 |
+
},
|
625 |
+
{
|
626 |
+
"output_type": "display_data",
|
627 |
+
"data": {
|
628 |
+
"text/plain": [
|
629 |
+
"<IPython.core.display.HTML object>"
|
630 |
+
],
|
631 |
+
"text/html": [
|
632 |
+
"\n",
|
633 |
+
" <div>\n",
|
634 |
+
" <progress value='811712512' class='' max='811706944' style='width:300px; height:20px; vertical-align: middle;'></progress>\n",
|
635 |
+
" 100.00% [811712512/811706944 00:24<00:00]\n",
|
636 |
+
" </div>\n",
|
637 |
+
" "
|
638 |
+
]
|
639 |
+
},
|
640 |
+
"metadata": {}
|
641 |
+
},
|
642 |
+
{
|
643 |
+
"output_type": "stream",
|
644 |
+
"name": "stderr",
|
645 |
+
"text": [
|
646 |
+
"/usr/local/lib/python3.7/dist-packages/torchvision/models/_utils.py:209: UserWarning: The parameter 'pretrained' is deprecated since 0.13 and will be removed in 0.15, please use 'weights' instead.\n",
|
647 |
+
" f\"The parameter '{pretrained_param}' is deprecated since 0.13 and will be removed in 0.15, \"\n",
|
648 |
+
"/usr/local/lib/python3.7/dist-packages/torchvision/models/_utils.py:223: UserWarning: Arguments other than a weight enum or `None` for 'weights' are deprecated since 0.13 and will be removed in 0.15. The current behavior is equivalent to passing `weights=ResNet18_Weights.IMAGENET1K_V1`. You can also use `weights=ResNet18_Weights.DEFAULT` to get the most up-to-date weights.\n",
|
649 |
+
" warnings.warn(msg)\n",
|
650 |
+
"Downloading: \"https://download.pytorch.org/models/resnet18-f37072fd.pth\" to /root/.cache/torch/hub/checkpoints/resnet18-f37072fd.pth\n"
|
651 |
+
]
|
652 |
+
},
|
653 |
+
{
|
654 |
+
"output_type": "display_data",
|
655 |
+
"data": {
|
656 |
+
"text/plain": [
|
657 |
+
" 0%| | 0.00/44.7M [00:00<?, ?B/s]"
|
658 |
+
],
|
659 |
+
"application/vnd.jupyter.widget-view+json": {
|
660 |
+
"version_major": 2,
|
661 |
+
"version_minor": 0,
|
662 |
+
"model_id": "03b5d8d7c0e342edaf1bf8c0dae84706"
|
663 |
+
}
|
664 |
+
},
|
665 |
+
"metadata": {}
|
666 |
+
},
|
667 |
+
{
|
668 |
+
"output_type": "display_data",
|
669 |
+
"data": {
|
670 |
+
"text/plain": [
|
671 |
+
"<IPython.core.display.HTML object>"
|
672 |
+
],
|
673 |
+
"text/html": [
|
674 |
+
"\n",
|
675 |
+
"<style>\n",
|
676 |
+
" /* Turns off some styling */\n",
|
677 |
+
" progress {\n",
|
678 |
+
" /* gets rid of default border in Firefox and Opera. */\n",
|
679 |
+
" border: none;\n",
|
680 |
+
" /* Needs to be in here for Safari polyfill so background images work as expected. */\n",
|
681 |
+
" background-size: auto;\n",
|
682 |
+
" }\n",
|
683 |
+
" progress:not([value]), progress:not([value])::-webkit-progress-bar {\n",
|
684 |
+
" background: repeating-linear-gradient(45deg, #7e7e7e, #7e7e7e 10px, #5c5c5c 10px, #5c5c5c 20px);\n",
|
685 |
+
" }\n",
|
686 |
+
" .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n",
|
687 |
+
" background: #F44336;\n",
|
688 |
+
" }\n",
|
689 |
+
"</style>\n"
|
690 |
+
]
|
691 |
+
},
|
692 |
+
"metadata": {}
|
693 |
+
},
|
694 |
+
{
|
695 |
+
"output_type": "display_data",
|
696 |
+
"data": {
|
697 |
+
"text/plain": [
|
698 |
+
"<IPython.core.display.HTML object>"
|
699 |
+
],
|
700 |
+
"text/html": [
|
701 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
702 |
+
" <thead>\n",
|
703 |
+
" <tr style=\"text-align: left;\">\n",
|
704 |
+
" <th>epoch</th>\n",
|
705 |
+
" <th>train_loss</th>\n",
|
706 |
+
" <th>valid_loss</th>\n",
|
707 |
+
" <th>error_rate</th>\n",
|
708 |
+
" <th>time</th>\n",
|
709 |
+
" </tr>\n",
|
710 |
+
" </thead>\n",
|
711 |
+
" <tbody>\n",
|
712 |
+
" <tr>\n",
|
713 |
+
" <td>0</td>\n",
|
714 |
+
" <td>0.213008</td>\n",
|
715 |
+
" <td>0.040320</td>\n",
|
716 |
+
" <td>0.010825</td>\n",
|
717 |
+
" <td>00:55</td>\n",
|
718 |
+
" </tr>\n",
|
719 |
+
" </tbody>\n",
|
720 |
+
"</table>"
|
721 |
+
]
|
722 |
+
},
|
723 |
+
"metadata": {}
|
724 |
+
},
|
725 |
+
{
|
726 |
+
"output_type": "display_data",
|
727 |
+
"data": {
|
728 |
+
"text/plain": [
|
729 |
+
"<IPython.core.display.HTML object>"
|
730 |
+
],
|
731 |
+
"text/html": [
|
732 |
+
"\n",
|
733 |
+
"<style>\n",
|
734 |
+
" /* Turns off some styling */\n",
|
735 |
+
" progress {\n",
|
736 |
+
" /* gets rid of default border in Firefox and Opera. */\n",
|
737 |
+
" border: none;\n",
|
738 |
+
" /* Needs to be in here for Safari polyfill so background images work as expected. */\n",
|
739 |
+
" background-size: auto;\n",
|
740 |
+
" }\n",
|
741 |
+
" progress:not([value]), progress:not([value])::-webkit-progress-bar {\n",
|
742 |
+
" background: repeating-linear-gradient(45deg, #7e7e7e, #7e7e7e 10px, #5c5c5c 10px, #5c5c5c 20px);\n",
|
743 |
+
" }\n",
|
744 |
+
" .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n",
|
745 |
+
" background: #F44336;\n",
|
746 |
+
" }\n",
|
747 |
+
"</style>\n"
|
748 |
+
]
|
749 |
+
},
|
750 |
+
"metadata": {}
|
751 |
+
},
|
752 |
+
{
|
753 |
+
"output_type": "display_data",
|
754 |
+
"data": {
|
755 |
+
"text/plain": [
|
756 |
+
"<IPython.core.display.HTML object>"
|
757 |
+
],
|
758 |
+
"text/html": [
|
759 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
760 |
+
" <thead>\n",
|
761 |
+
" <tr style=\"text-align: left;\">\n",
|
762 |
+
" <th>epoch</th>\n",
|
763 |
+
" <th>train_loss</th>\n",
|
764 |
+
" <th>valid_loss</th>\n",
|
765 |
+
" <th>error_rate</th>\n",
|
766 |
+
" <th>time</th>\n",
|
767 |
+
" </tr>\n",
|
768 |
+
" </thead>\n",
|
769 |
+
" <tbody>\n",
|
770 |
+
" <tr>\n",
|
771 |
+
" <td>0</td>\n",
|
772 |
+
" <td>0.070559</td>\n",
|
773 |
+
" <td>0.033851</td>\n",
|
774 |
+
" <td>0.010825</td>\n",
|
775 |
+
" <td>00:53</td>\n",
|
776 |
+
" </tr>\n",
|
777 |
+
" </tbody>\n",
|
778 |
+
"</table>"
|
779 |
+
]
|
780 |
+
},
|
781 |
+
"metadata": {}
|
782 |
+
}
|
783 |
+
],
|
784 |
+
"source": [
|
785 |
+
"from fastai.vision.all import *\n",
|
786 |
+
"path = untar_data(URLs.PETS)\n",
|
787 |
+
"files = get_image_files(path/\"images\")\n",
|
788 |
+
"def is_cat(x): return x[0].isupper() \n",
|
789 |
+
"dls = ImageDataLoaders.from_name_func(\n",
|
790 |
+
" path,\n",
|
791 |
+
" files,\n",
|
792 |
+
" pat='(.+)_\\d+.jpg',\n",
|
793 |
+
" splitter=RandomSplitter(valid_pct=0.2, seed=42),\n",
|
794 |
+
" label_func=is_cat, \n",
|
795 |
+
" item_tfms=Resize(192),\n",
|
796 |
+
" batch_tfms=aug_transforms(size=224, min_scale=0.75))"
|
797 |
+
]
|
798 |
+
},
|
799 |
+
{
|
800 |
+
"cell_type": "markdown",
|
801 |
+
"source": [
|
802 |
+
"## Find model arch and weights / Write and debug model code"
|
803 |
+
],
|
804 |
+
"metadata": {
|
805 |
+
"id": "_17JIq8glHTs"
|
806 |
+
}
|
807 |
+
},
|
808 |
+
{
|
809 |
+
"cell_type": "code",
|
810 |
+
"source": [
|
811 |
+
"learn = vision_learner(dls, resnet18, metrics=error_rate)\n",
|
812 |
+
"learn.fine_tune(1)\n",
|
813 |
+
"learn.path = Path('.')\n",
|
814 |
+
"learn.export('model.pkl')"
|
815 |
+
],
|
816 |
+
"metadata": {
|
817 |
+
"id": "YwdkNpnak2T0"
|
818 |
+
},
|
819 |
+
"execution_count": null,
|
820 |
+
"outputs": []
|
821 |
+
},
|
822 |
+
{
|
823 |
+
"cell_type": "markdown",
|
824 |
+
"source": [
|
825 |
+
"## Deploy model"
|
826 |
+
],
|
827 |
+
"metadata": {
|
828 |
+
"id": "RBxVHB9jlTGj"
|
829 |
+
}
|
830 |
+
},
|
831 |
+
{
|
832 |
+
"cell_type": "code",
|
833 |
+
"source": [
|
834 |
+
"learn = load_learner('model.pkl')"
|
835 |
+
],
|
836 |
+
"metadata": {
|
837 |
+
"id": "wWaLAeHUhZ3A"
|
838 |
+
},
|
839 |
+
"execution_count": 3,
|
840 |
+
"outputs": []
|
841 |
+
},
|
842 |
+
{
|
843 |
+
"cell_type": "code",
|
844 |
+
"source": [
|
845 |
+
"categories = ('Dog', 'Cat')"
|
846 |
+
],
|
847 |
+
"metadata": {
|
848 |
+
"id": "YKRiQRudh_FY"
|
849 |
+
},
|
850 |
+
"execution_count": 4,
|
851 |
+
"outputs": []
|
852 |
+
},
|
853 |
+
{
|
854 |
+
"cell_type": "code",
|
855 |
+
"source": [
|
856 |
+
"def classify_image(img):\n",
|
857 |
+
" pred, idx, probs = learn.predict(img)\n",
|
858 |
+
" return dict(zip(categories, map(float, probs)))"
|
859 |
+
],
|
860 |
+
"metadata": {
|
861 |
+
"id": "aIInhbiOh_xG"
|
862 |
+
},
|
863 |
+
"execution_count": 10,
|
864 |
+
"outputs": []
|
865 |
+
},
|
866 |
+
{
|
867 |
+
"cell_type": "code",
|
868 |
+
"source": [
|
869 |
+
"#hide_output\n",
|
870 |
+
"import gradio as gr\n",
|
871 |
+
"\n",
|
872 |
+
"image = gr.inputs.Image(shape=(192, 192))\n",
|
873 |
+
"label = gr.outputs.Label()\n",
|
874 |
+
"examples = ['Dog.jpg', 'cat.jpg', 'dunno.jpg']\n",
|
875 |
+
"title = \"Dogs V Cats Classifier\"\n",
|
876 |
+
"description = \"A classifier trained on the Oxford Pets dataset with fastai. Created as a demo for Gradio and HuggingFace Spaces.\"\n",
|
877 |
+
"interpretation='default'\n",
|
878 |
+
"enable_queue=True\n",
|
879 |
+
"\n",
|
880 |
+
"intf = gr.Interface(\n",
|
881 |
+
" fn=classify_image,\n",
|
882 |
+
" inputs=image,\n",
|
883 |
+
" outputs=label,\n",
|
884 |
+
" examples=examples,\n",
|
885 |
+
" title=title,\n",
|
886 |
+
" description=description,\n",
|
887 |
+
" interpretation=interpretation,\n",
|
888 |
+
" enable_queue=enable_queue\n",
|
889 |
+
")\n",
|
890 |
+
"\n",
|
891 |
+
"intf.launch(inline=True, share=True)"
|
892 |
+
],
|
893 |
+
"metadata": {
|
894 |
+
"colab": {
|
895 |
+
"base_uri": "https://localhost:8080/",
|
896 |
+
"height": 836
|
897 |
+
},
|
898 |
+
"id": "8pOqkLe3igZp",
|
899 |
+
"outputId": "b8d290b2-eac4-41c3-d14d-6a974ac701b9"
|
900 |
+
},
|
901 |
+
"execution_count": 11,
|
902 |
+
"outputs": [
|
903 |
+
{
|
904 |
+
"output_type": "stream",
|
905 |
+
"name": "stderr",
|
906 |
+
"text": [
|
907 |
+
"/usr/local/lib/python3.7/dist-packages/gradio/inputs.py:257: UserWarning: Usage of gradio.inputs is deprecated, and will not be supported in the future, please import your component from gradio.components\n",
|
908 |
+
" \"Usage of gradio.inputs is deprecated, and will not be supported in the future, please import your component from gradio.components\",\n",
|
909 |
+
"/usr/local/lib/python3.7/dist-packages/gradio/deprecation.py:40: UserWarning: `optional` parameter is deprecated, and it has no effect\n",
|
910 |
+
" warnings.warn(value)\n",
|
911 |
+
"/usr/local/lib/python3.7/dist-packages/gradio/outputs.py:197: UserWarning: Usage of gradio.outputs is deprecated, and will not be supported in the future, please import your components from gradio.components\n",
|
912 |
+
" \"Usage of gradio.outputs is deprecated, and will not be supported in the future, please import your components from gradio.components\",\n",
|
913 |
+
"/usr/local/lib/python3.7/dist-packages/gradio/deprecation.py:40: UserWarning: The 'type' parameter has been deprecated. Use the Number component instead.\n",
|
914 |
+
" warnings.warn(value)\n",
|
915 |
+
"/usr/local/lib/python3.7/dist-packages/gradio/deprecation.py:40: UserWarning: `enable_queue` is deprecated in `Interface()`, please use it within `launch()` instead.\n",
|
916 |
+
" warnings.warn(value)\n"
|
917 |
+
]
|
918 |
+
},
|
919 |
+
{
|
920 |
+
"output_type": "stream",
|
921 |
+
"name": "stdout",
|
922 |
+
"text": [
|
923 |
+
"Colab notebook detected. To show errors in colab notebook, set `debug=True` in `launch()`\n",
|
924 |
+
"Running on public URL: https://17c82fbf8dced356.gradio.app\n",
|
925 |
+
"\n",
|
926 |
+
"This share link expires in 72 hours. For free permanent hosting and GPU upgrades (NEW!), check out Spaces: https://huggingface.co/spaces\n"
|
927 |
+
]
|
928 |
+
},
|
929 |
+
{
|
930 |
+
"output_type": "display_data",
|
931 |
+
"data": {
|
932 |
+
"text/plain": [
|
933 |
+
"<IPython.core.display.HTML object>"
|
934 |
+
],
|
935 |
+
"text/html": [
|
936 |
+
"<div><iframe src=\"https://17c82fbf8dced356.gradio.app\" width=\"900\" height=\"500\" allow=\"autoplay; camera; microphone; clipboard-read; clipboard-write;\" frameborder=\"0\" allowfullscreen></iframe></div>"
|
937 |
+
]
|
938 |
+
},
|
939 |
+
"metadata": {}
|
940 |
+
},
|
941 |
+
{
|
942 |
+
"output_type": "execute_result",
|
943 |
+
"data": {
|
944 |
+
"text/plain": [
|
945 |
+
"(<gradio.routes.App at 0x7fa2568dca90>,\n",
|
946 |
+
" 'http://127.0.0.1:7861/',\n",
|
947 |
+
" 'https://17c82fbf8dced356.gradio.app')"
|
948 |
+
]
|
949 |
+
},
|
950 |
+
"metadata": {},
|
951 |
+
"execution_count": 11
|
952 |
+
}
|
953 |
+
]
|
954 |
+
}
|
955 |
+
]
|
956 |
+
}
|