Update app.py
Browse files
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 '
|
98 |
|
99 |
# Parameters:
|
100 |
-
# df (pd.DataFrame): The DataFrame containing the '
|
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=['
|
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 "
|
131 |
-
dataframe = dataframe[~dataframe["
|
132 |
-
if "
|
133 |
-
dataframe = dataframe[~dataframe["
|
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 |
-
"
|
181 |
-
"
|
182 |
-
"
|
183 |
-
"
|
184 |
-
"
|
185 |
],
|
186 |
-
"
|
187 |
-
"
|
188 |
-
"
|
189 |
-
"
|
190 |
-
"
|
191 |
-
"
|
192 |
],
|
193 |
-
"
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
],
|
200 |
-
"
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
],
|
207 |
-
"
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
],
|
214 |
"AVG": [
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
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=["
|
243 |
-
value=["
|
244 |
-
label="
|
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 |
-
["
|
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",
|