Roni Goldshmidt commited on
Commit
4150653
·
1 Parent(s): a197e82

Initial leaderboard setup

Browse files
Files changed (2) hide show
  1. .ipynb_checkpoints/app-checkpoint.py +23 -2
  2. app.py +23 -2
.ipynb_checkpoints/app-checkpoint.py CHANGED
@@ -221,15 +221,36 @@ with tab2:
221
  model_idx = row * models_per_row + col_idx
222
  if model_idx < len(selected_models):
223
  model = selected_models[model_idx]
 
 
 
 
 
 
224
  # Store toggle state in session state with unique key
225
  toggle_key = f"toggle_{model}"
226
  if toggle_key not in st.session_state:
227
  st.session_state[toggle_key] = True
228
- st.session_state[toggle_key] = cols[col_idx].checkbox(
229
- model,
 
 
230
  value=st.session_state[toggle_key],
231
  key=f"model_toggle_{model}"
232
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
233
 
234
  # Individual Precision-Recall plots for each class
235
  unique_classes = class_data['Class'].unique()
 
221
  model_idx = row * models_per_row + col_idx
222
  if model_idx < len(selected_models):
223
  model = selected_models[model_idx]
224
+ container = cols[col_idx].container()
225
+
226
+ # Get Plotly's default color for this model index
227
+ plotly_colors = ['#636EFA', '#EF553B', '#00CC96', '#AB63FA', '#FFA15A', '#19D3F3', '#FF6692', '#B6E880', '#FF97FF', '#FECB52']
228
+ color = plotly_colors[model_idx % len(plotly_colors)]
229
+
230
  # Store toggle state in session state with unique key
231
  toggle_key = f"toggle_{model}"
232
  if toggle_key not in st.session_state:
233
  st.session_state[toggle_key] = True
234
+
235
+ # Create the checkbox with colored text
236
+ st.session_state[toggle_key] = container.checkbox(
237
+ f"⬤ {model}", # Add a colored circle before the model name
238
  value=st.session_state[toggle_key],
239
  key=f"model_toggle_{model}"
240
  )
241
+
242
+ # Add colored style to the label
243
+ container.markdown(
244
+ f"""
245
+ <style>
246
+ [data-testid="stCheckbox"] label p {{
247
+ color: {color};
248
+ font-weight: bold;
249
+ }}
250
+ </style>
251
+ """,
252
+ unsafe_allow_html=True
253
+ )
254
 
255
  # Individual Precision-Recall plots for each class
256
  unique_classes = class_data['Class'].unique()
app.py CHANGED
@@ -221,15 +221,36 @@ with tab2:
221
  model_idx = row * models_per_row + col_idx
222
  if model_idx < len(selected_models):
223
  model = selected_models[model_idx]
 
 
 
 
 
 
224
  # Store toggle state in session state with unique key
225
  toggle_key = f"toggle_{model}"
226
  if toggle_key not in st.session_state:
227
  st.session_state[toggle_key] = True
228
- st.session_state[toggle_key] = cols[col_idx].checkbox(
229
- model,
 
 
230
  value=st.session_state[toggle_key],
231
  key=f"model_toggle_{model}"
232
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
233
 
234
  # Individual Precision-Recall plots for each class
235
  unique_classes = class_data['Class'].unique()
 
221
  model_idx = row * models_per_row + col_idx
222
  if model_idx < len(selected_models):
223
  model = selected_models[model_idx]
224
+ container = cols[col_idx].container()
225
+
226
+ # Get Plotly's default color for this model index
227
+ plotly_colors = ['#636EFA', '#EF553B', '#00CC96', '#AB63FA', '#FFA15A', '#19D3F3', '#FF6692', '#B6E880', '#FF97FF', '#FECB52']
228
+ color = plotly_colors[model_idx % len(plotly_colors)]
229
+
230
  # Store toggle state in session state with unique key
231
  toggle_key = f"toggle_{model}"
232
  if toggle_key not in st.session_state:
233
  st.session_state[toggle_key] = True
234
+
235
+ # Create the checkbox with colored text
236
+ st.session_state[toggle_key] = container.checkbox(
237
+ f"⬤ {model}", # Add a colored circle before the model name
238
  value=st.session_state[toggle_key],
239
  key=f"model_toggle_{model}"
240
  )
241
+
242
+ # Add colored style to the label
243
+ container.markdown(
244
+ f"""
245
+ <style>
246
+ [data-testid="stCheckbox"] label p {{
247
+ color: {color};
248
+ font-weight: bold;
249
+ }}
250
+ </style>
251
+ """,
252
+ unsafe_allow_html=True
253
+ )
254
 
255
  # Individual Precision-Recall plots for each class
256
  unique_classes = class_data['Class'].unique()