Spaces:
Sleeping
Sleeping
Commit
·
b2490a6
1
Parent(s):
ae6ea44
Update app.py
Browse files
app.py
CHANGED
@@ -1,14 +1,15 @@
|
|
1 |
-
|
|
|
|
|
|
|
2 |
learn=load_learner('model.pkl')
|
3 |
categories=('Dog','Cat')
|
4 |
def classify_image(img):
|
5 |
pred,ind,probs=learn.predict(img)
|
6 |
return dict(zip(categories,map(float,probs)))
|
7 |
-
|
8 |
-
import gradio as gr
|
9 |
image=gr.inputs.Image(shape=(192,192))
|
10 |
label=gr.outputs.Label()
|
11 |
|
12 |
-
def greet(name): return f"hello {name}"
|
13 |
|
14 |
gr.Interface(fn=classify_image,inputs=image,outputs=label).launch()
|
|
|
1 |
+
from fastai.vision.all import *
|
2 |
+
import gradio as gr
|
3 |
+
def is_cat(x):return x[0].isupper()
|
4 |
+
|
5 |
learn=load_learner('model.pkl')
|
6 |
categories=('Dog','Cat')
|
7 |
def classify_image(img):
|
8 |
pred,ind,probs=learn.predict(img)
|
9 |
return dict(zip(categories,map(float,probs)))
|
10 |
+
|
|
|
11 |
image=gr.inputs.Image(shape=(192,192))
|
12 |
label=gr.outputs.Label()
|
13 |
|
|
|
14 |
|
15 |
gr.Interface(fn=classify_image,inputs=image,outputs=label).launch()
|