Nunzio commited on
Commit
983dafc
·
1 Parent(s): 43be5ef

improved colors

Browse files
Files changed (2) hide show
  1. app.py +2 -2
  2. prova.html +0 -3
app.py CHANGED
@@ -86,12 +86,12 @@ with gr.Blocks(title="Semantic Segmentation Predictors") as demo:
86
  with gr.Column(scale=1):
87
  color_box0 = f"""<span style='display:inline-block; width:15px; height:15px;
88
  background-color:rgb({legend[i][3][0]},{legend[i][3][1]},{legend[i][3][2]}); margin-left:6px; border:1px solid #000;'></span>"""
89
- gr.HTML(f"<b>{legend[i][1]}</b> → {legend[i][2]} {color_box0}")
90
  with gr.Column(scale=1):
91
  if i + 1 < len(legend):
92
  color_box1 = f"""<span style='display:inline-block; width:15px; height:15px;
93
  background-color:rgb({legend[i+1][3][0]},{legend[i+1][3][1]},{legend[i+1][3][2]}); margin-left:6px; border:1px solid #000;'></span>"""
94
- gr.HTML(f"<b>{legend[i+1][1]}</b> → {legend[i+1][2]} {color_box1}")
95
  else:
96
  gr.Markdown("") # Keeps spacing consistent if list is odd
97
 
 
86
  with gr.Column(scale=1):
87
  color_box0 = f"""<span style='display:inline-block; width:15px; height:15px;
88
  background-color:rgb({legend[i][3][0]},{legend[i][3][1]},{legend[i][3][2]}); margin-left:6px; border:1px solid #000;'></span>"""
89
+ gr.HTML(f"<div style='display:flex; align-items:center; margin-bottom:2px;'><b>{legend[i][1]}</b> → {color_box0}</div>")
90
  with gr.Column(scale=1):
91
  if i + 1 < len(legend):
92
  color_box1 = f"""<span style='display:inline-block; width:15px; height:15px;
93
  background-color:rgb({legend[i+1][3][0]},{legend[i+1][3][1]},{legend[i+1][3][2]}); margin-left:6px; border:1px solid #000;'></span>"""
94
+ gr.HTML(f"<div style='display:flex; align-items:center; margin-bottom:2px;'><b>{legend[i+1][1]}</b> → {color_box1}</div>")
95
  else:
96
  gr.Markdown("") # Keeps spacing consistent if list is odd
97
 
prova.html DELETED
@@ -1,3 +0,0 @@
1
- <span style='display:inline-block; width:15px; height:15px;
2
- background-color:rgb(255,0,0); margin-left:6px;
3
- border:1px solid #000;'></span>