Beansbeansbeansbeans commited on
Commit
5f3b37b
·
verified ·
1 Parent(s): 621b8c6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -1
app.py CHANGED
@@ -122,4 +122,19 @@ def predict_image(inp):
122
 
123
  with gr.Blocks(title="Trash Classification") as demo:
124
  gr.Markdown("# Check whether your trash is recyclable or not!", elem_id="custom_title")
125
- gr.Markdown("Gradio Inference interface for classification of trash and recyclables. To use it, simply upload your image, or click one of the examples to load them. Images uploaded are never saved or indexed. No data
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
122
 
123
  with gr.Blocks(title="Trash Classification") as demo:
124
  gr.Markdown("# Check whether your trash is recyclable or not!", elem_id="custom_title")
125
+ gr.Markdown("Gradio Inference interface for classification of trash and recyclables. To use it, simply upload your image, or click one of the examples to load them. Images uploaded are never saved or indexed. No data is saved. This space is free to use.", elem_id="desc1")
126
+ gr.Markdown("Also feel free to go through the examples shown!", elem_id="desc2")
127
+
128
+ inp = gr.Image(source="upload", type="filepath", label="Upload Your Image Here", elem_id="image_input")
129
+
130
+ material_probs = gr.Label(label="Material Classification Probabilities", elem_id="material_probs")
131
+ specific_probs = gr.Label(label="Specific Classification Probabilities", elem_id="specific_probs")
132
+ recyclable_qn = gr.Textbox(label="Item Recyclability", elem_id="recyclable_qn")
133
+ recyclable_advice = gr.Textbox(label="Recycling Advice", elem_id="recyclable_advice")
134
+
135
+ btn = gr.Button("Classify", elem_id="classify_btn")
136
+ btn.click(fn=predict_image, inputs=inp, outputs=[material_probs, specific_probs, recyclable_qn, recyclable_advice])
137
+
138
+ examples = gr.Examples(examples=examples, inputs=inp, outputs=[material_probs, specific_probs, recyclable_qn, recyclable_advice])
139
+
140
+ demo.launch()