sdCarr commited on
Commit
645d801
1 Parent(s): f5910c1
Files changed (1) hide show
  1. app.py +9 -5
app.py CHANGED
@@ -11,10 +11,14 @@ def predict(img):
11
  return {labels[i]: float(probs[i]) for i in range(len(labels))}
12
 
13
  title = "Tomatoes Classifier"
14
- description = "A tomatoes classifier trained with dataset ddg images with fastai. Created as a demo for Gradio and HuggingFace Spaces."
15
- article="<p style='text-align: center'><a href='https://tmabraham.github.io/blog/gradio_hf_spaces_tutorial' target='_blank'>Blog post</a></p>"
16
- examples = ['Cherry Tomatoes','Grape Tomatoes', 'Roma Tomatoes','Beefsteak Tomatoes','Green tomatoes','Kumato Tomatoes','Heirloom Tomatoes']
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()
 
 
 
11
  return {labels[i]: float(probs[i]) for i in range(len(labels))}
12
 
13
  title = "Tomatoes Classifier"
14
+
15
+ image = gr.inputs.Image(shape=(192, 192))
16
+ label = gr.outputs.Label()
17
+ examples = ['cherry.jpeg','grape.jpeg', 'roma.jpeg','beefsteak.jpeg','green.jpeg','kumato.jpeg','heirloom.jpeg']
18
+
19
+
20
  enable_queue=True
21
 
22
+ intf = gr.Interface(fn=predict, inputs=image, outputs=label, examples=examples)
23
+
24
+ intf.launch(inline=False)