Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -20,6 +20,10 @@ for dirname, _, filenames in os.walk('/kaggle/input'):
|
|
| 20 |
|
| 21 |
import gradio as gr
|
| 22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
# Assuming no shape needs to be specified directly in the constructor
|
| 24 |
image = gr.Image()
|
| 25 |
label = gr.Label()
|
|
|
|
| 20 |
|
| 21 |
import gradio as gr
|
| 22 |
|
| 23 |
+
def classify_image(img):
|
| 24 |
+
pred,idx,probs = learn.predict(img)
|
| 25 |
+
return dict(zip(categories, map(float,probs)))
|
| 26 |
+
|
| 27 |
# Assuming no shape needs to be specified directly in the constructor
|
| 28 |
image = gr.Image()
|
| 29 |
label = gr.Label()
|