Nunzio commited on
Commit
87e9613
·
1 Parent(s): c6560b4

new layout

Browse files
Files changed (1) hide show
  1. app.py +10 -10
app.py CHANGED
@@ -76,17 +76,17 @@ with gr.Blocks(title="Semantic Segmentation Predictors") as demo:
76
  with gr.Column():
77
  result_display = gr.Image(label="Model prediction", visible=True)
78
  error_text = gr.Markdown("", visible=False)
 
79
  with gr.Row():
80
- gr.Markdown("The legend of the classes is the following (format **name** -> **color**)")
81
- string = ""
82
- with gr.Row():
83
- for i, (id, name, color) in enumerate(legendHandling()):
84
- if i and not i % 2:
85
- with gr.Row():
86
- gr.Markdown(string)
87
- string = ""
88
-
89
- string += f"\t **{name}** -> {color}"
90
 
91
  with gr.Row():
92
  gr.Markdown("## Preloaded images to be used for testing the model")
 
76
  with gr.Column():
77
  result_display = gr.Image(label="Model prediction", visible=True)
78
  error_text = gr.Markdown("", visible=False)
79
+ gr.Markdown("The legend of the classes is the following (format **name** -> **color**)")
80
  with gr.Row():
81
+ for i in range(0, len(legendHandling()), 2):
82
+ with gr.Row():
83
+ gr.Markdown(f"**{legendHandling()[i][1]}** → {legendHandling()[i][2]}")
84
+
85
+ if i + 1 < len(legendHandling()):
86
+ gr.Markdown(f"**{legendHandling()[i + 1][1]}** → {legendHandling()[i + 1][2]}")
87
+ else:
88
+ gr.Markdown("") # Fills the second column if odd number of items
89
+
 
90
 
91
  with gr.Row():
92
  gr.Markdown("## Preloaded images to be used for testing the model")