Update app.py
Browse files
app.py
CHANGED
@@ -57,11 +57,16 @@ def detect_objects(image):
|
|
57 |
|
58 |
# Membuat antarmuka Gradio dengan label yang telah diganti
|
59 |
iface = gr.Interface(
|
60 |
-
fn=detect_objects,
|
61 |
-
inputs=gr.Image(type="pil", label="Input Image"),
|
62 |
-
outputs=[gr.Image(label="Detect Object"), gr.Textbox(label="Counting Object")],
|
63 |
-
live=True
|
64 |
-
|
|
|
|
|
|
|
|
|
|
|
65 |
)
|
66 |
|
67 |
# Menjalankan antarmuka
|
|
|
57 |
|
58 |
# Membuat antarmuka Gradio dengan label yang telah diganti
|
59 |
iface = gr.Interface(
|
60 |
+
fn=detect_objects, # Fungsi yang dipanggil saat gambar diupload
|
61 |
+
inputs=gr.Image(type="pil", label="Input Image"), # Ganti label input
|
62 |
+
outputs=[gr.Image(label="Detect Object"), gr.Textbox(label="Counting Object")], # Ganti label output
|
63 |
+
live=True # Menampilkan hasil secara langsung
|
64 |
+
)
|
65 |
+
|
66 |
+
# Membungkus input dan output dalam gr.Row() untuk layout berdampingan
|
67 |
+
iface.layout = gr.Row(
|
68 |
+
iface.inputs, # Input image component
|
69 |
+
iface.outputs # Output components (image and text)
|
70 |
)
|
71 |
|
72 |
# Menjalankan antarmuka
|