Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,11 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
|
3 |
-
|
4 |
-
|
|
|
|
|
|
|
5 |
|
6 |
-
demo = gr.Interface(fn=
|
7 |
demo.launch()
|
|
|
1 |
import gradio as gr
|
2 |
+
from fastai.learner import load_learner
|
3 |
|
4 |
+
learn = load_learner('model.pkl')
|
5 |
+
labels = ['Adidas Shoe', 'New Balance Shoe', 'Nike Show']
|
6 |
+
def predict(image):
|
7 |
+
brand, idx, probs = learn.predict(image)
|
8 |
+
return dict(zip(labels, map(float,probs)))
|
9 |
|
10 |
+
demo = gr.Interface(fn=predict, inputs=gr.Image(), outputs=gr.Label())
|
11 |
demo.launch()
|