testing
Browse files
app.ipynb
CHANGED
@@ -34,7 +34,7 @@
|
|
34 |
},
|
35 |
{
|
36 |
"cell_type": "code",
|
37 |
-
"execution_count":
|
38 |
"metadata": {},
|
39 |
"outputs": [],
|
40 |
"source": [
|
@@ -48,7 +48,7 @@
|
|
48 |
},
|
49 |
{
|
50 |
"cell_type": "code",
|
51 |
-
"execution_count":
|
52 |
"metadata": {},
|
53 |
"outputs": [
|
54 |
{
|
@@ -94,7 +94,7 @@
|
|
94 |
"{'Dog': 0.9999974966049194, 'Cat': 2.5427661967114545e-06}"
|
95 |
]
|
96 |
},
|
97 |
-
"execution_count":
|
98 |
"metadata": {},
|
99 |
"output_type": "execute_result"
|
100 |
}
|
@@ -105,7 +105,7 @@
|
|
105 |
},
|
106 |
{
|
107 |
"cell_type": "code",
|
108 |
-
"execution_count":
|
109 |
"metadata": {},
|
110 |
"outputs": [
|
111 |
{
|
@@ -126,7 +126,7 @@
|
|
126 |
"name": "stdout",
|
127 |
"output_type": "stream",
|
128 |
"text": [
|
129 |
-
"Running on local URL: http://127.0.0.1:
|
130 |
"\n",
|
131 |
"To create a public link, set `share=True` in `launch()`.\n"
|
132 |
]
|
@@ -134,10 +134,10 @@
|
|
134 |
{
|
135 |
"data": {
|
136 |
"text/plain": [
|
137 |
-
"(<gradio.routes.App at
|
138 |
]
|
139 |
},
|
140 |
-
"execution_count":
|
141 |
"metadata": {},
|
142 |
"output_type": "execute_result"
|
143 |
},
|
@@ -242,6 +242,80 @@
|
|
242 |
"metadata": {},
|
243 |
"output_type": "display_data"
|
244 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
245 |
{
|
246 |
"data": {
|
247 |
"text/html": [],
|
|
|
34 |
},
|
35 |
{
|
36 |
"cell_type": "code",
|
37 |
+
"execution_count": 4,
|
38 |
"metadata": {},
|
39 |
"outputs": [],
|
40 |
"source": [
|
|
|
48 |
},
|
49 |
{
|
50 |
"cell_type": "code",
|
51 |
+
"execution_count": 5,
|
52 |
"metadata": {},
|
53 |
"outputs": [
|
54 |
{
|
|
|
94 |
"{'Dog': 0.9999974966049194, 'Cat': 2.5427661967114545e-06}"
|
95 |
]
|
96 |
},
|
97 |
+
"execution_count": 5,
|
98 |
"metadata": {},
|
99 |
"output_type": "execute_result"
|
100 |
}
|
|
|
105 |
},
|
106 |
{
|
107 |
"cell_type": "code",
|
108 |
+
"execution_count": null,
|
109 |
"metadata": {},
|
110 |
"outputs": [
|
111 |
{
|
|
|
126 |
"name": "stdout",
|
127 |
"output_type": "stream",
|
128 |
"text": [
|
129 |
+
"Running on local URL: http://127.0.0.1:7860\n",
|
130 |
"\n",
|
131 |
"To create a public link, set `share=True` in `launch()`.\n"
|
132 |
]
|
|
|
134 |
{
|
135 |
"data": {
|
136 |
"text/plain": [
|
137 |
+
"(<gradio.routes.App at 0x1795c7e50>, 'http://127.0.0.1:7860/', None)"
|
138 |
]
|
139 |
},
|
140 |
+
"execution_count": 6,
|
141 |
"metadata": {},
|
142 |
"output_type": "execute_result"
|
143 |
},
|
|
|
242 |
"metadata": {},
|
243 |
"output_type": "display_data"
|
244 |
},
|
245 |
+
{
|
246 |
+
"data": {
|
247 |
+
"text/html": [],
|
248 |
+
"text/plain": [
|
249 |
+
"<IPython.core.display.HTML object>"
|
250 |
+
]
|
251 |
+
},
|
252 |
+
"metadata": {},
|
253 |
+
"output_type": "display_data"
|
254 |
+
},
|
255 |
+
{
|
256 |
+
"data": {
|
257 |
+
"text/html": [
|
258 |
+
"\n",
|
259 |
+
"<style>\n",
|
260 |
+
" /* Turns off some styling */\n",
|
261 |
+
" progress {\n",
|
262 |
+
" /* gets rid of default border in Firefox and Opera. */\n",
|
263 |
+
" border: none;\n",
|
264 |
+
" /* Needs to be in here for Safari polyfill so background images work as expected. */\n",
|
265 |
+
" background-size: auto;\n",
|
266 |
+
" }\n",
|
267 |
+
" progress:not([value]), progress:not([value])::-webkit-progress-bar {\n",
|
268 |
+
" background: repeating-linear-gradient(45deg, #7e7e7e, #7e7e7e 10px, #5c5c5c 10px, #5c5c5c 20px);\n",
|
269 |
+
" }\n",
|
270 |
+
" .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n",
|
271 |
+
" background: #F44336;\n",
|
272 |
+
" }\n",
|
273 |
+
"</style>\n"
|
274 |
+
],
|
275 |
+
"text/plain": [
|
276 |
+
"<IPython.core.display.HTML object>"
|
277 |
+
]
|
278 |
+
},
|
279 |
+
"metadata": {},
|
280 |
+
"output_type": "display_data"
|
281 |
+
},
|
282 |
+
{
|
283 |
+
"data": {
|
284 |
+
"text/html": [],
|
285 |
+
"text/plain": [
|
286 |
+
"<IPython.core.display.HTML object>"
|
287 |
+
]
|
288 |
+
},
|
289 |
+
"metadata": {},
|
290 |
+
"output_type": "display_data"
|
291 |
+
},
|
292 |
+
{
|
293 |
+
"data": {
|
294 |
+
"text/html": [
|
295 |
+
"\n",
|
296 |
+
"<style>\n",
|
297 |
+
" /* Turns off some styling */\n",
|
298 |
+
" progress {\n",
|
299 |
+
" /* gets rid of default border in Firefox and Opera. */\n",
|
300 |
+
" border: none;\n",
|
301 |
+
" /* Needs to be in here for Safari polyfill so background images work as expected. */\n",
|
302 |
+
" background-size: auto;\n",
|
303 |
+
" }\n",
|
304 |
+
" progress:not([value]), progress:not([value])::-webkit-progress-bar {\n",
|
305 |
+
" background: repeating-linear-gradient(45deg, #7e7e7e, #7e7e7e 10px, #5c5c5c 10px, #5c5c5c 20px);\n",
|
306 |
+
" }\n",
|
307 |
+
" .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n",
|
308 |
+
" background: #F44336;\n",
|
309 |
+
" }\n",
|
310 |
+
"</style>\n"
|
311 |
+
],
|
312 |
+
"text/plain": [
|
313 |
+
"<IPython.core.display.HTML object>"
|
314 |
+
]
|
315 |
+
},
|
316 |
+
"metadata": {},
|
317 |
+
"output_type": "display_data"
|
318 |
+
},
|
319 |
{
|
320 |
"data": {
|
321 |
"text/html": [],
|
app.py
CHANGED
@@ -20,9 +20,6 @@ def classify_image(img):
|
|
20 |
pred,idx,probs = learn.predict(img)
|
21 |
return dict(zip(categories,map(float,probs)))
|
22 |
|
23 |
-
# %%
|
24 |
-
classify_image('dog.jpeg')
|
25 |
-
|
26 |
# %%
|
27 |
#/export
|
28 |
image = gr.inputs.Image(shape=(192,192))
|
|
|
20 |
pred,idx,probs = learn.predict(img)
|
21 |
return dict(zip(categories,map(float,probs)))
|
22 |
|
|
|
|
|
|
|
23 |
# %%
|
24 |
#/export
|
25 |
image = gr.inputs.Image(shape=(192,192))
|