Spaces:
Sleeping
Sleeping
feat: Test out the Pet breeds
Browse files- app.py +17 -4
- export.pkl +3 -0
app.py
CHANGED
@@ -1,7 +1,20 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
|
3 |
-
|
4 |
-
return "Hello " + name + "!!"
|
5 |
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
+
from fastai.vision.all import *
|
3 |
|
4 |
+
learn = load_learner('export.pkl')
|
|
|
5 |
|
6 |
+
def classify_image(img):
|
7 |
+
pred, pred_idx, probs = learn.predict(img)
|
8 |
+
return dict(zip(learn.dls.vocab, map(float, probs)))
|
9 |
+
|
10 |
+
# def greet(name):
|
11 |
+
# return "Hello " + name + "!!"
|
12 |
+
|
13 |
+
image = gr.Image(height=192, width=192)
|
14 |
+
|
15 |
+
intf = gr.Interface(fn=classify_image,
|
16 |
+
inputs=image,
|
17 |
+
outputs='label'
|
18 |
+
)
|
19 |
+
|
20 |
+
intf.launch(inline=False)
|
export.pkl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5ff9c22c165cd5ae647c3b509a863e4edbc7de843529e2d8d74f0b2cb154972c
|
3 |
+
size 103057644
|