Update app.py
Browse files
app.py
CHANGED
@@ -7,11 +7,11 @@ learn = load_learner('export.pkl')
|
|
7 |
labels = learn.dls.vocab
|
8 |
|
9 |
|
10 |
-
|
11 |
-
|
12 |
def predict(img):
|
13 |
img = PILImage.create(img)
|
14 |
pred,pred_idx,probs = learn.predict(img)
|
15 |
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
16 |
|
17 |
-
|
|
|
|
|
|
7 |
labels = learn.dls.vocab
|
8 |
|
9 |
|
|
|
|
|
10 |
def predict(img):
|
11 |
img = PILImage.create(img)
|
12 |
pred,pred_idx,probs = learn.predict(img)
|
13 |
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
14 |
|
15 |
+
image = gr.inputs.Image(shape=(192, 192))
|
16 |
+
label = gr.outputs.Label(num_top_classes=3)
|
17 |
+
gr.Interface(fn=predict, inputs=image, outputs=label).launch(share=True)
|