Spaces:
Running
Running
fix issues
Browse files- utils_v2.py +0 -18
utils_v2.py
CHANGED
|
@@ -158,24 +158,6 @@ def rank_models(df, column='Overall', rank_name='Rank'):
|
|
| 158 |
df[rank_name] = range(1, len(df) + 1)
|
| 159 |
return df
|
| 160 |
|
| 161 |
-
def add_color_to_column(df)
|
| 162 |
-
def render_color(text, color):
|
| 163 |
-
"""Renders the text in a specific color for Markdown."""
|
| 164 |
-
return f"<span style='color:{color};'>{text}</span>"
|
| 165 |
-
|
| 166 |
-
df = df.copy()
|
| 167 |
-
SUB_TASKS = SUB_TASKS_I + SUB_TASKS_V + SUB_TASKS_D
|
| 168 |
-
MOD_OVERALL = ['Image-Overall', 'Video-Overall', 'Visdoc-Overall']
|
| 169 |
-
assert all(col in df.columns for col in ["Overall"] + MOD_OVERALL + SUB_TASKS), f"Missing columns in DataFrame: {SUB_TASKS}"
|
| 170 |
-
renamed_columns = {'Overall': render_color('Overall', 'red')}
|
| 171 |
-
for col in MOD_OVERALL:
|
| 172 |
-
renamed_columns[col] = render_color(col, 'yellow')
|
| 173 |
-
for col in SUB_TASKS:
|
| 174 |
-
renamed_columns[col] = render_color(col, 'blue')
|
| 175 |
-
|
| 176 |
-
df.rename(columns=renamed_columns)
|
| 177 |
-
return df
|
| 178 |
-
|
| 179 |
def get_df():
|
| 180 |
"""Generates a DataFrame from the loaded data."""
|
| 181 |
all_data = load_data()
|
|
|
|
| 158 |
df[rank_name] = range(1, len(df) + 1)
|
| 159 |
return df
|
| 160 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 161 |
def get_df():
|
| 162 |
"""Generates a DataFrame from the loaded data."""
|
| 163 |
all_data = load_data()
|