Asis commited on
Commit
ca56088
1 Parent(s): cd4cbfc
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -1,5 +1,6 @@
1
- from fastai.vision.all import *
2
  import gradio as gr
 
 
3
 
4
  learn = load_learner('model.pkl')
5
 
@@ -9,7 +10,11 @@ def predict(img):
9
  pred,pred_idx,probs = learn.predict(img)
10
  return {labels[i]: float(probs[i]) for i in range(len(labels))}
11
 
12
- title = "Empty PLate Classifier"
13
  description = "We are passionate about the emptiness of plates, but it is often rather challenging to determine whether a plate is empty or not. This model will help you in that task!"
 
 
 
 
14
 
15
- gr.Interface(fn=predict, inputs=gr.inputs.Image(shape=(512, 512)), outputs=gr.outputs.Label(num_top_classes=3)).launch(share=True)
 
 
1
  import gradio as gr
2
+ from fastai.vision.all import *
3
+ import skimage
4
 
5
  learn = load_learner('model.pkl')
6
 
 
10
  pred,pred_idx,probs = learn.predict(img)
11
  return {labels[i]: float(probs[i]) for i in range(len(labels))}
12
 
13
+ title = "Empty Plate Classifier"
14
  description = "We are passionate about the emptiness of plates, but it is often rather challenging to determine whether a plate is empty or not. This model will help you in that task!"
15
+ article = "<p style='text-align: center'><a href='https://foodand.eu/' target='_blank'>Food& Magazine</a></p>"
16
+ examples = ['empty_plate.jpeg', 'full_plate.jpeg']
17
+ interpretation = 'default'
18
+ enable_queue = True
19
 
20
+ gr.Interface(fn=predict,inputs=gr.inputs.Image(shape=(512, 512)),outputs=gr.outputs.Label(num_top_classes=3),title=title,description=description,article=article,examples=examples,interpretation=interpretation,enable_queue=enable_queue).launch()