Update app.py
Browse files
app.py
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
import gradio as gr
|
2 |
from fastai.vision.all import *
|
3 |
|
4 |
-
def
|
5 |
learn = load_learner('model.pkl')
|
6 |
|
7 |
-
categories = ('
|
8 |
|
9 |
def classify_image(img):
|
10 |
pred,idx,probs = learn.predict(img)
|
@@ -12,7 +12,7 @@ def classify_image(img):
|
|
12 |
|
13 |
image = gr.Image(height=192, width = 192)
|
14 |
label = gr.Label()
|
15 |
-
examples = ['
|
16 |
|
17 |
inf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
|
18 |
inf.launch(inline=False,share=True)
|
|
|
1 |
import gradio as gr
|
2 |
from fastai.vision.all import *
|
3 |
|
4 |
+
def is_cat(x): return x[0].isupper()
|
5 |
learn = load_learner('model.pkl')
|
6 |
|
7 |
+
categories = ('cat', 'forest')
|
8 |
|
9 |
def classify_image(img):
|
10 |
pred,idx,probs = learn.predict(img)
|
|
|
12 |
|
13 |
image = gr.Image(height=192, width = 192)
|
14 |
label = gr.Label()
|
15 |
+
examples = ['cat.jpg', 'forest.jpg']
|
16 |
|
17 |
inf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
|
18 |
inf.launch(inline=False,share=True)
|