Spaces:
Running
Running
Try changing interactive state a different way
Browse files
app.py
CHANGED
@@ -78,7 +78,7 @@ def gallery_selected(evt: gr.SelectData):
|
|
78 |
|
79 |
:return: index of the currently selected image
|
80 |
"""
|
81 |
-
proceed_button.interactive = evt.selected
|
82 |
print(f"Index: {evt.index}, Value: {evt.value}, Selected: {evt.selected}")
|
83 |
return evt.index
|
84 |
|
@@ -99,7 +99,7 @@ if __name__ == "__main__":
|
|
99 |
yolos_input = gr.Image(type="pil")
|
100 |
yolos_submit = gr.Button("Submit")
|
101 |
yolos_output = gr.Gallery(label="Detected Objects", object_fit="scale-down", columns=3, scale=1,
|
102 |
-
show_share_button=False,
|
103 |
|
104 |
with gr.Row():
|
105 |
yolos_selected = gr.TextArea(label="Selected Image Index")
|
|
|
78 |
|
79 |
:return: index of the currently selected image
|
80 |
"""
|
81 |
+
proceed_button.interactive = gr.Button(interactive=evt.selected)
|
82 |
print(f"Index: {evt.index}, Value: {evt.value}, Selected: {evt.selected}")
|
83 |
return evt.index
|
84 |
|
|
|
99 |
yolos_input = gr.Image(type="pil")
|
100 |
yolos_submit = gr.Button("Submit")
|
101 |
yolos_output = gr.Gallery(label="Detected Objects", object_fit="scale-down", columns=3, scale=1,
|
102 |
+
show_share_button=False, selected_index=None)
|
103 |
|
104 |
with gr.Row():
|
105 |
yolos_selected = gr.TextArea(label="Selected Image Index")
|