RuudVelo commited on
Commit
aa58452
·
1 Parent(s): 52386cc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -20
app.py CHANGED
@@ -1,20 +0,0 @@
1
- import gradio as gr
2
- from fastai.vision.all import *
3
- import skimage
4
- import pickle
5
-
6
- learn = load_learner('CNN_SNACKDETECTOR_MODEL_2.pkl')
7
-
8
- labels = learn.dls.vocab
9
- def predict(img):
10
- img = PILImage.create(img)
11
- pred,pred_idx,probs = learn.predict(img)
12
- return {labels[i]: float(probs[i]) for i in range(len(labels))}
13
-
14
- title = "Dutch Snack Detector"
15
- description = "Dutch Snack Detector: Detect your Dutch snack and enjoy"
16
- examples = ['frikandel.jpg']
17
- #interpretation='default'
18
- enable_queue=True
19
-
20
- gr.Interface(fn=predict,inputs=gr.inputs.Image(shape=(224, 224)),outputs=gr.outputs.Label(num_top_classes=3),title=title,description=description,article=article,examples=examples,interpretation=interpretation,enable_queue=enable_queue).launch()