Spaces:
Runtime error
Runtime error
davidrd123
commited on
Commit
·
fb4cb72
1
Parent(s):
8ed17bc
updated app.py
Browse files
app.py
CHANGED
@@ -6,11 +6,11 @@ learn = load_learner('movements_05_02_22_4pm.pkl')
|
|
6 |
|
7 |
def predict(img):
|
8 |
labels = learn.dls.vocab
|
9 |
-
|
10 |
-
pred,pred_idx,probs = learn.predict(
|
11 |
-
return {
|
12 |
|
13 |
-
examples = [f"Image{n:02d}.jpg" for n in range(
|
14 |
|
15 |
gr.Interface(fn=predict,
|
16 |
inputs=gr.inputs.Image(shape=((512,512))),
|
|
|
6 |
|
7 |
def predict(img):
|
8 |
labels = learn.dls.vocab
|
9 |
+
img = PILImage.create(img)
|
10 |
+
pred,pred_idx,probs = learn.predict(img)
|
11 |
+
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
12 |
|
13 |
+
examples = [f"Image{n:02d}.jpg" for n in range(20)]
|
14 |
|
15 |
gr.Interface(fn=predict,
|
16 |
inputs=gr.inputs.Image(shape=((512,512))),
|