Update app.py
Browse files
app.py
CHANGED
@@ -54,17 +54,14 @@ def detect_objects(image):
|
|
54 |
with gr.Blocks() as iface:
|
55 |
with gr.Row():
|
56 |
with gr.Column():
|
57 |
-
input_image = gr.Image(type="pil", label="Input Image")
|
58 |
with gr.Column():
|
59 |
output_image = gr.Image(label="Detect Object")
|
60 |
with gr.Column():
|
61 |
output_text = gr.Textbox(label="Counting Object")
|
62 |
|
63 |
-
#
|
64 |
-
|
65 |
-
|
66 |
-
# Hubungkan tombol dengan fungsi deteksi
|
67 |
-
detect_button.click(
|
68 |
fn=detect_objects,
|
69 |
inputs=input_image,
|
70 |
outputs=[output_image, output_text]
|
|
|
54 |
with gr.Blocks() as iface:
|
55 |
with gr.Row():
|
56 |
with gr.Column():
|
57 |
+
input_image = gr.Image(type="pil", label="Input Image", live=True)
|
58 |
with gr.Column():
|
59 |
output_image = gr.Image(label="Detect Object")
|
60 |
with gr.Column():
|
61 |
output_text = gr.Textbox(label="Counting Object")
|
62 |
|
63 |
+
# Hubungkan input dengan fungsi deteksi
|
64 |
+
input_image.change(
|
|
|
|
|
|
|
65 |
fn=detect_objects,
|
66 |
inputs=input_image,
|
67 |
outputs=[output_image, output_text]
|