Spaces:
Sleeping
Sleeping
app fix
Browse files
app.py
CHANGED
@@ -1,17 +1,17 @@
|
|
1 |
-
from
|
2 |
-
from fastai.vision.widgets import *
|
3 |
import gradio as gr
|
4 |
|
5 |
|
6 |
learn = load_learner("export.pkl" )
|
|
|
7 |
|
8 |
def classify_image(img):
|
9 |
pred, pred_idx, probs = learn.predict(img)
|
10 |
-
return
|
11 |
|
12 |
-
bear_types = 'grizzly' , 'black' , 'teddy'
|
13 |
|
14 |
-
|
|
|
15 |
|
16 |
label = gr.outputs.Label()
|
17 |
|
|
|
1 |
+
from fastai.vision.all import *
|
|
|
2 |
import gradio as gr
|
3 |
|
4 |
|
5 |
learn = load_learner("export.pkl" )
|
6 |
+
bear_types = ('grizzly' , 'black' , 'teddy')
|
7 |
|
8 |
def classify_image(img):
|
9 |
pred, pred_idx, probs = learn.predict(img)
|
10 |
+
return dict(zip(bear_types , map(float , probs)))
|
11 |
|
|
|
12 |
|
13 |
+
|
14 |
+
image = gr.inputs.Image(shape=(224 , 224))
|
15 |
|
16 |
label = gr.outputs.Label()
|
17 |
|