Spaces:
Running on Zero
Running on Zero
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from fastai.vision.all import *
|
| 2 |
+
import gradio as gr
|
| 3 |
+
|
| 4 |
+
learn = load_learner('model.pkl')
|
| 5 |
+
|
| 6 |
+
def predict(img):
|
| 7 |
+
# fill in: call learn.predict(), build the dict for Gradio's Label output
|
| 8 |
+
pass
|
| 9 |
+
|
| 10 |
+
gr.Interface(
|
| 11 |
+
fn=predict,
|
| 12 |
+
inputs=gr.Image(type='pil'),
|
| 13 |
+
outputs=gr.Label(num_top_classes=3)
|
| 14 |
+
).launch()
|