Spaces:
Runtime error
Runtime error
Amar Gill
commited on
Commit
•
832be83
1
Parent(s):
4b1f91a
fix import
Browse files
app.py
CHANGED
@@ -1,6 +1,5 @@
|
|
1 |
import gradio as gr
|
2 |
-
from
|
3 |
-
from fastai.vision.all import load_learner
|
4 |
|
5 |
|
6 |
def is_cat(x):
|
@@ -14,7 +13,7 @@ labels = learn.dls.vocab
|
|
14 |
|
15 |
|
16 |
def predict(img):
|
17 |
-
img =
|
18 |
pred, pred_idx, probs = learn.predict(img)
|
19 |
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
20 |
|
|
|
1 |
import gradio as gr
|
2 |
+
from fastai.vision.all import load_learner, PILImage
|
|
|
3 |
|
4 |
|
5 |
def is_cat(x):
|
|
|
13 |
|
14 |
|
15 |
def predict(img):
|
16 |
+
img = PILImage.create(img)
|
17 |
pred, pred_idx, probs = learn.predict(img)
|
18 |
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
19 |
|