Spaces:
Sleeping
Sleeping
Nunzio commited on
Commit ·
d7e37f8
1
Parent(s): 4d2f437
added buttons
Browse files
app.py
CHANGED
|
@@ -83,16 +83,19 @@ with gr.Blocks(title="Semantic Segmentation Predictors") as demo:
|
|
| 83 |
with gr.Row():
|
| 84 |
gr.Markdown("## Preloaded images to be used for testing the model")
|
| 85 |
gr.Markdown("You can use images from the Grand Theft Auto V video game, the Cityscapes dataset or even from Turin")
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
|
|
|
|
|
|
|
|
|
| 96 |
|
| 97 |
submit_btn.click(
|
| 98 |
fn=run_prediction,
|
|
|
|
| 83 |
with gr.Row():
|
| 84 |
gr.Markdown("## Preloaded images to be used for testing the model")
|
| 85 |
gr.Markdown("You can use images from the Grand Theft Auto V video game, the Cityscapes dataset or even from Turin")
|
| 86 |
+
for i in range(0, len(image_list), 5):
|
| 87 |
+
with gr.Row():
|
| 88 |
+
for img, path in image_list[i:i+5]:
|
| 89 |
+
with gr.Column(scale=1):
|
| 90 |
+
gr.Image(value=img, show_label=False, show_download_button=False, height=150)
|
| 91 |
+
btn = gr.Button(" ", visible=True)
|
| 92 |
+
btn.style(height=150, width=150, border_radius="10px", background_color="#f0f0f0", font_size="1px")
|
| 93 |
+
def make_on_click(image):
|
| 94 |
+
def on_click():
|
| 95 |
+
return image
|
| 96 |
+
return on_click
|
| 97 |
+
|
| 98 |
+
btn.click(fn=make_on_click(img), outputs=image_input)
|
| 99 |
|
| 100 |
submit_btn.click(
|
| 101 |
fn=run_prediction,
|