Tiger model added
Browse files
app.py
CHANGED
@@ -1,11 +1,10 @@
|
|
1 |
from fastai.vision.all import *
|
2 |
import gradio as gr
|
3 |
|
4 |
-
def is_cat(x): return x[0].isupper()
|
5 |
|
6 |
|
7 |
-
learn = load_learner('model.pkl')
|
8 |
-
categories = ('
|
9 |
|
10 |
def classify_img(img):
|
11 |
preds, idx, probs = learn.predict(img)
|
@@ -13,7 +12,7 @@ def classify_img(img):
|
|
13 |
|
14 |
image = gr.Image(shape=(192, 192))
|
15 |
label = gr.Label()
|
16 |
-
examples = ['
|
17 |
|
18 |
iface = gr.Interface(fn=classify_img, inputs=image, outputs=label, examples=examples)
|
19 |
iface.launch()
|
|
|
1 |
from fastai.vision.all import *
|
2 |
import gradio as gr
|
3 |
|
|
|
4 |
|
5 |
|
6 |
+
learn = load_learner('tiger-model.pkl')
|
7 |
+
categories = ('Bengal', 'Siberian', 'White')
|
8 |
|
9 |
def classify_img(img):
|
10 |
preds, idx, probs = learn.predict(img)
|
|
|
12 |
|
13 |
image = gr.Image(shape=(192, 192))
|
14 |
label = gr.Label()
|
15 |
+
examples = ['sib-tiger.jpg']
|
16 |
|
17 |
iface = gr.Interface(fn=classify_img, inputs=image, outputs=label, examples=examples)
|
18 |
iface.launch()
|
cat.jpg
DELETED
Binary file (10.2 kB)
|
|
dog.jpg
DELETED
Binary file (70.8 kB)
|
|