Repoaner commited on
Commit
3b0c761
·
verified ·
1 Parent(s): 4aa567d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +45 -45
app.py CHANGED
@@ -94,10 +94,10 @@ def restart_space():
94
  # }
95
  # def color_model_type_column(df, color_map):
96
  # """
97
- # Apply color to the 'Model Type' column of the DataFrame based on a given color mapping.
98
 
99
  # Parameters:
100
- # df (pd.DataFrame): The DataFrame containing the 'Model Type' column.
101
  # color_map (dict): A dictionary mapping model types to colors.
102
 
103
  # Returns:
@@ -113,7 +113,7 @@ def restart_space():
113
  # format_dict['Overall Score'] = "{:.2f}"
114
  # format_dict[''] = "{:d}"
115
 
116
- # return df.style.applymap(apply_color, subset=['Model Type']).format(format_dict, na_rep='')
117
 
118
  def regex_table(dataframe, regex, filter_button, style=True):
119
  """
@@ -127,10 +127,10 @@ def regex_table(dataframe, regex, filter_button, style=True):
127
  # if filter_button, remove all rows with "ai2" in the model name
128
  update_scores = False
129
  if isinstance(filter_button, list) or isinstance(filter_button, str):
130
- if "Integrated LVLM" not in filter_button:
131
- dataframe = dataframe[~dataframe["Model Type"].str.contains("Integrated LVLM", case=False, na=False)]
132
- if "Interleaved LVLM" not in filter_button:
133
- dataframe = dataframe[~dataframe["Model Type"].str.contains("Interleaved LVLM", case=False, na=False)]
134
  # Filter the dataframe such that 'model' contains any of the regex patterns
135
  data = dataframe[dataframe["Model"].str.contains(combined_regex, case=False, na=False)]
136
 
@@ -177,46 +177,46 @@ def avg_all_perspective(orig_df: pd.DataFrame, columns_name: list, meta_data=MET
177
 
178
  data = {
179
  "Model": [
180
- "MiniGPT-5", "EMU-2", "GILL", "Anole",
181
- "GPT-4o | Openjourney", "GPT-4o | SD-3", "GPT-4o | SD-XL", "GPT-4o | Flux",
182
- "Gemini-1.5 | Openjourney", "Gemini-1.5 | SD-3", "Gemini-1.5 | SD-XL", "Gemini-1.5 | Flux",
183
- "LLAVA-34b | Openjourney", "LLAVA-34b | SD-3", "LLAVA-34b | SD-XL", "LLAVA-34b | Flux",
184
- "Qwen-VL-70b | Openjourney", "Qwen-VL-70b | SD-3", "Qwen-VL-70b | SD-XL", "Qwen-VL-70b | Flux"
185
  ],
186
- "Model Type":[
187
- "Interleaved LVLM", "Interleaved LVLM", "Interleaved LVLM", "Interleaved LVLM",
188
- "Integrated LVLM", "Integrated LVLM", "Integrated LVLM", "Integrated LVLM",
189
- "Integrated LVLM", "Integrated LVLM", "Integrated LVLM", "Integrated LVLM",
190
- "Integrated LVLM", "Integrated LVLM", "Integrated LVLM", "Integrated LVLM",
191
- "Integrated LVLM", "Integrated LVLM", "Integrated LVLM", "Integrated LVLM",
192
  ],
193
- "Situational analysis": [
194
- 47.63, 39.65, 46.72, 48.95,
195
- 53.05, 53.00, 56.12, 54.97,
196
- 48.08, 47.48, 49.43, 47.07,
197
- 54.12, 54.72, 55.97, 54.23,
198
- 52.73, 54.98, 52.58, 54.23
199
  ],
200
- "Project-based learning": [
201
- 55.12, 46.12, 57.57, 59.05,
202
- 71.40, 71.20, 73.25, 68.80,
203
- 67.93, 68.70, 71.85, 68.33,
204
- 73.47, 72.55, 74.60, 71.32,
205
- 71.63, 71.87, 73.57, 69.47
206
  ],
207
- "Multi-step reasoning": [
208
- 42.17, 50.75, 39.33, 51.72,
209
- 53.67, 53.67, 53.67, 53.67,
210
- 60.05, 60.05, 60.05, 60.05,
211
- 47.28, 47.28, 47.28, 47.28,
212
- 55.63, 55.63, 55.63, 55.63
213
  ],
214
  "AVG": [
215
- 50.92, 45.33, 51.58, 55.22,
216
- 63.65, 63.52, 65.47, 62.63,
217
- 61.57, 61.87, 64.15, 61.55,
218
- 63.93, 63.57, 65.05, 62.73,
219
- 64.05, 64.75, 65.12, 63.18
220
  ]
221
  }
222
  df = pd.DataFrame(data)
@@ -239,9 +239,9 @@ with gr.Blocks(css=custom_css) as app:
239
  show_label=False
240
  )
241
  model_type_overall = gr.CheckboxGroup(
242
- choices=["Interleaved LVLM", "Integrated LVLM"],
243
- value=["Interleaved LVLM", "Integrated LVLM"],
244
- label="Model Type",
245
  show_label=False,
246
  interactive=True,
247
  )
@@ -257,7 +257,7 @@ with gr.Blocks(css=custom_css) as app:
257
  regex_table(
258
  df.copy(),
259
  "",
260
- ["Interleaved LVLM", "Integrated LVLM"]
261
  ),
262
  headers=df.columns.tolist(),
263
  elem_id="Align_Anything_leadboard_overall",
 
94
  # }
95
  # def color_model_type_column(df, color_map):
96
  # """
97
+ # Apply color to the 'Modality' column of the DataFrame based on a given color mapping.
98
 
99
  # Parameters:
100
+ # df (pd.DataFrame): The DataFrame containing the 'Modality' column.
101
  # color_map (dict): A dictionary mapping model types to colors.
102
 
103
  # Returns:
 
113
  # format_dict['Overall Score'] = "{:.2f}"
114
  # format_dict[''] = "{:d}"
115
 
116
+ # return df.style.applymap(apply_color, subset=['Modality']).format(format_dict, na_rep='')
117
 
118
  def regex_table(dataframe, regex, filter_button, style=True):
119
  """
 
127
  # if filter_button, remove all rows with "ai2" in the model name
128
  update_scores = False
129
  if isinstance(filter_button, list) or isinstance(filter_button, str):
130
+ if "Image-Text-to-Text" not in filter_button:
131
+ dataframe = dataframe[~dataframe["Modality"].str.contains("Image-Text-to-Text", case=False, na=False)]
132
+ if "Video-Text-to-Text" not in filter_button:
133
+ dataframe = dataframe[~dataframe["Modality"].str.contains("Video-Text-to-Text", case=False, na=False)]
134
  # Filter the dataframe such that 'model' contains any of the regex patterns
135
  data = dataframe[dataframe["Model"].str.contains(combined_regex, case=False, na=False)]
136
 
 
177
 
178
  data = {
179
  "Model": [
180
+ "Beaver-Vision-11B", "Beaver-Vision-11B", "Beaver-Vision-11B", "Beaver-Vision-11B",
181
+ "Beaver-Vision-11B", "Beaver-Vision-11B", "Beaver-Vision-11B", "Beaver-Vision-11B",
182
+ "Beaver-Vision-11B", "Beaver-Vision-11B", "Beaver-Vision-11B", "Beaver-Vision-11B",
183
+ "Beaver-Vision-11B", "Beaver-Vision-11B", "Beaver-Vision-11B", "Beaver-Vision-11B",
184
+ "Beaver-Vision-11B", "Beaver-Vision-11B", "Beaver-Vision-11B", "Beaver-Vision-11B",
185
  ],
186
+ "Modality":[
187
+ "Image-Text-to-Text", "Image-Text-to-Text", "Image-Text-to-Text", "Image-Text-to-Text",
188
+ "Image-Text-to-Text", "Image-Text-to-Text", "Image-Text-to-Text", "Image-Text-to-Text",
189
+ "Image-Text-to-Text", "Image-Text-to-Text", "Image-Text-to-Text", "Image-Text-to-Text",
190
+ "Image-Text-to-Text", "Image-Text-to-Text", "Image-Text-to-Text", "Image-Text-to-Text",
191
+ "Image-Text-to-Text", "Image-Text-to-Text", "Image-Text-to-Text", "Image-Text-to-Text",
192
  ],
193
+ "Correctness of Information": [
194
+ 100.00, 100.00, 100.00, 100.00,
195
+ 100.00, 100.00, 100.00, 100.00,
196
+ 100.00, 100.00, 100.00, 100.00,
197
+ 100.00, 100.00, 100.00, 100.00,
198
+ 100.00, 100.00, 100.00, 100.00,
199
  ],
200
+ "Detail Orientation": [
201
+ 100.00, 100.00, 100.00, 100.00,
202
+ 100.00, 100.00, 100.00, 100.00,
203
+ 100.00, 100.00, 100.00, 100.00,
204
+ 100.00, 100.00, 100.00, 100.00,
205
+ 100.00, 100.00, 100.00, 100.00,
206
  ],
207
+ "Safety": [
208
+ 100.00, 100.00, 100.00, 100.00,
209
+ 100.00, 100.00, 100.00, 100.00,
210
+ 100.00, 100.00, 100.00, 100.00,
211
+ 100.00, 100.00, 100.00, 100.00,
212
+ 100.00, 100.00, 100.00, 100.00,
213
  ],
214
  "AVG": [
215
+ 100.00, 100.00, 100.00, 100.00,
216
+ 100.00, 100.00, 100.00, 100.00,
217
+ 100.00, 100.00, 100.00, 100.00,
218
+ 100.00, 100.00, 100.00, 100.00,
219
+ 100.00, 100.00, 100.00, 100.00,
220
  ]
221
  }
222
  df = pd.DataFrame(data)
 
239
  show_label=False
240
  )
241
  model_type_overall = gr.CheckboxGroup(
242
+ choices=["Image-Text-to-Text", "Video-Text-to-Text"],
243
+ value=["Image-Text-to-Text", "Video-Text-to-Text"],
244
+ label="Modality",
245
  show_label=False,
246
  interactive=True,
247
  )
 
257
  regex_table(
258
  df.copy(),
259
  "",
260
+ ["Video-Text-to-Text", "Image-Text-to-Text"]
261
  ),
262
  headers=df.columns.tolist(),
263
  elem_id="Align_Anything_leadboard_overall",