muhammadsalmanalfaridzi commited on
Commit
a6bf8fc
·
verified ·
1 Parent(s): 16fa06b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -9
app.py CHANGED
@@ -153,16 +153,22 @@ def detect_combined(image):
153
  # ========== Gradio Interface ==========
154
  with gr.Blocks(theme=gr.themes.Base(primary_hue="teal", secondary_hue="teal", neutral_hue="slate")) as iface:
155
  gr.Markdown("""<div style="text-align: center;"><h1>NESTLE - STOCK COUNTING</h1></div>""")
156
- with gr.Column():
157
- with gr.Row():
158
  input_image = gr.Image(type="pil", label="Input Image")
159
- with gr.Row():
160
- detect_image_button = gr.Button("Detect Image")
161
- with gr.Row():
162
  output_image = gr.Image(label="Detect Object")
163
- with gr.Row():
164
  output_text = gr.Textbox(label="Counting Object")
165
 
166
- detect_image_button.click(fn=detect_combined, inputs=input_image, outputs=[output_image, output_text])
167
-
168
- iface.launch()
 
 
 
 
 
 
 
 
 
153
  # ========== Gradio Interface ==========
154
  with gr.Blocks(theme=gr.themes.Base(primary_hue="teal", secondary_hue="teal", neutral_hue="slate")) as iface:
155
  gr.Markdown("""<div style="text-align: center;"><h1>NESTLE - STOCK COUNTING</h1></div>""")
156
+ with gr.Row():
157
+ with gr.Column():
158
  input_image = gr.Image(type="pil", label="Input Image")
159
+ with gr.Column():
 
 
160
  output_image = gr.Image(label="Detect Object")
161
+ with gr.Column():
162
  output_text = gr.Textbox(label="Counting Object")
163
 
164
+ # Tombol untuk memproses input
165
+ detect_button = gr.Button("Detect")
166
+
167
+ # Hubungkan tombol dengan fungsi deteksi
168
+ detect_button.click(
169
+ fn=detect_combined,
170
+ inputs=input_image,
171
+ outputs=[output_image, output_text]
172
+ )
173
+
174
+ iface.launch()