Spaces:
Sleeping
Sleeping
Tomas Ellis
commited on
Commit
·
f4b6a7d
1
Parent(s):
8cd4681
more fixes
Browse files- app copy.py +0 -17
- app.ipynb +3 -3
app copy.py
DELETED
@@ -1,17 +0,0 @@
|
|
1 |
-
from fastai.vision.all import *
|
2 |
-
import gradio as gr
|
3 |
-
|
4 |
-
learn = load_learner('catornot_model.pkl')
|
5 |
-
|
6 |
-
categories = ('Dog', 'Cat')
|
7 |
-
|
8 |
-
def classify_image(img):
|
9 |
-
pred, idx, probs = learn.predict(img)
|
10 |
-
return dict(zip(categories, map(float, probs)))
|
11 |
-
|
12 |
-
image = gr.inputs.Image(shape=(192, 192))
|
13 |
-
label = gr.outputs.Label()
|
14 |
-
examples = ['dog.jpg', 'cat.jpg', 'dunno.jpg']
|
15 |
-
|
16 |
-
intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
|
17 |
-
intf.launch(inline=False)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app.ipynb
CHANGED
@@ -165,8 +165,8 @@
|
|
165 |
"name": "stdout",
|
166 |
"output_type": "stream",
|
167 |
"text": [
|
168 |
-
"CPU times: user
|
169 |
-
"Wall time:
|
170 |
]
|
171 |
},
|
172 |
{
|
@@ -315,7 +315,7 @@
|
|
315 |
},
|
316 |
{
|
317 |
"cell_type": "code",
|
318 |
-
"execution_count":
|
319 |
"id": "4083f107-04ed-4248-9acd-45f142a0869f",
|
320 |
"metadata": {},
|
321 |
"outputs": [],
|
|
|
165 |
"name": "stdout",
|
166 |
"output_type": "stream",
|
167 |
"text": [
|
168 |
+
"CPU times: user 1.33 s, sys: 1.57 s, total: 2.9 s\n",
|
169 |
+
"Wall time: 197 ms\n"
|
170 |
]
|
171 |
},
|
172 |
{
|
|
|
315 |
},
|
316 |
{
|
317 |
"cell_type": "code",
|
318 |
+
"execution_count": 9,
|
319 |
"id": "4083f107-04ed-4248-9acd-45f142a0869f",
|
320 |
"metadata": {},
|
321 |
"outputs": [],
|