Update app.py
Browse files
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.
|
157 |
-
with gr.
|
158 |
input_image = gr.Image(type="pil", label="Input Image")
|
159 |
-
with gr.
|
160 |
-
detect_image_button = gr.Button("Detect Image")
|
161 |
-
with gr.Row():
|
162 |
output_image = gr.Image(label="Detect Object")
|
163 |
-
with gr.
|
164 |
output_text = gr.Textbox(label="Counting Object")
|
165 |
|
166 |
-
|
167 |
-
|
168 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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()
|