Update app.py
Browse files
app.py
CHANGED
@@ -12,12 +12,13 @@ categories = (['calling', 'clapping', 'cycling', 'dancing', 'drinking', 'eating'
|
|
12 |
|
13 |
|
14 |
def classify_image(img):
|
|
|
15 |
pred,idx,probs = learn.predict(img)
|
16 |
return dict(zip(categories, map(float,probs)))
|
17 |
|
18 |
|
19 |
|
20 |
-
image = gr.Image(
|
21 |
label = gr.Label()
|
22 |
examples = ['laughing.jpg', 'dancing.jpg', 'drinking.jpg']
|
23 |
|
|
|
12 |
|
13 |
|
14 |
def classify_image(img):
|
15 |
+
img = PILImage.create(img).resize((192, 192))
|
16 |
pred,idx,probs = learn.predict(img)
|
17 |
return dict(zip(categories, map(float,probs)))
|
18 |
|
19 |
|
20 |
|
21 |
+
image = gr.Image(type='pil')
|
22 |
label = gr.Label()
|
23 |
examples = ['laughing.jpg', 'dancing.jpg', 'drinking.jpg']
|
24 |
|