Spaces:
Runtime error
Runtime error
fix
Browse files- app.py +5 -4
- requirements.txt +1 -1
app.py
CHANGED
@@ -1,5 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
-
from fastai import *
|
|
|
|
|
3 |
|
4 |
|
5 |
def classify_img(img):
|
@@ -8,11 +10,10 @@ def classify_img(img):
|
|
8 |
return dict(zip(categories, map(float, probs)))
|
9 |
|
10 |
|
11 |
-
learn = load_learner("first_model.pkl")
|
12 |
-
|
13 |
image = gr.inputs.Image(shape=(100, 100))
|
14 |
label = gr.outputs.Label()
|
15 |
examples = ["suiseicz.png", "tokocz.jpg"]
|
16 |
|
17 |
-
|
|
|
18 |
iface.launch(inline=False)
|
|
|
1 |
import gradio as gr
|
2 |
+
from fastai.vision.all import *
|
3 |
+
|
4 |
+
learn = load_learner("first_model.pkl")
|
5 |
|
6 |
|
7 |
def classify_img(img):
|
|
|
10 |
return dict(zip(categories, map(float, probs)))
|
11 |
|
12 |
|
|
|
|
|
13 |
image = gr.inputs.Image(shape=(100, 100))
|
14 |
label = gr.outputs.Label()
|
15 |
examples = ["suiseicz.png", "tokocz.jpg"]
|
16 |
|
17 |
+
|
18 |
+
iface = gr.Interface(fn=classify_img, inputs=image, outputs=label, examples=examples)
|
19 |
iface.launch(inline=False)
|
requirements.txt
CHANGED
@@ -1 +1 @@
|
|
1 |
-
fastai
|
|
|
1 |
+
fastai
|