Spaces:
Running
Running
Commit
·
1d2abde
1
Parent(s):
52a119d
update_leaderboard
Browse files- serve/leaderboard.py +15 -12
serve/leaderboard.py
CHANGED
|
@@ -40,7 +40,8 @@ nam_dict = {
|
|
| 40 |
"syncdreamer": "SyncDreamer",
|
| 41 |
"triplane-gaussian": "TriplaneGaussian",
|
| 42 |
"escher-net": "EscherNet",
|
| 43 |
-
"free3d": "Free3D"
|
|
|
|
| 44 |
}
|
| 45 |
|
| 46 |
def replace_model_name(name, rank):
|
|
@@ -91,11 +92,11 @@ def model_hyperlink(model_name, link):
|
|
| 91 |
|
| 92 |
def load_leaderboard_table_csv(filename, add_hyperlink=True):
|
| 93 |
df = pd.read_csv(filename)
|
| 94 |
-
df = df.drop(df[df["
|
| 95 |
for col in df.columns:
|
| 96 |
if "Elo rating" in col:
|
| 97 |
-
print(df[col])
|
| 98 |
-
df[col] = df[col].apply(lambda x: int(x) if (x != "-" and x
|
| 99 |
|
| 100 |
if add_hyperlink and col == "Model":
|
| 101 |
df[col] = df.apply(lambda row: model_hyperlink(row[col], row["Link"]), axis=1)
|
|
@@ -127,7 +128,7 @@ def get_full_table(anony_arena_df, full_arena_df, model_table_df):
|
|
| 127 |
values = []
|
| 128 |
for i in range(len(model_table_df)):
|
| 129 |
row = []
|
| 130 |
-
model_key = model_table_df.iloc[i]["
|
| 131 |
model_name = model_table_df.iloc[i]["Model"]
|
| 132 |
# model display name
|
| 133 |
row.append(model_name)
|
|
@@ -161,10 +162,10 @@ def get_arena_table(arena_dfs, model_table_df):
|
|
| 161 |
for i in range(len(model_table_df)):
|
| 162 |
row = []
|
| 163 |
# model_key = arena_df.index[i]
|
| 164 |
-
# model_name = model_table_df[model_table_df["
|
| 165 |
# 0
|
| 166 |
# ]
|
| 167 |
-
model_name = model_table_df.iloc[i]["
|
| 168 |
|
| 169 |
# rank
|
| 170 |
row.append(i + 1)
|
|
@@ -173,8 +174,10 @@ def get_arena_table(arena_dfs, model_table_df):
|
|
| 173 |
# elo rating
|
| 174 |
num_battles = 0
|
| 175 |
for dim in arena_dfs.keys():
|
| 176 |
-
|
| 177 |
-
|
|
|
|
|
|
|
| 178 |
row.append(round(arena_dfs[dim].loc[model_name]["rating"], 2))
|
| 179 |
upper_diff = round(arena_dfs[dim].loc[model_name]["rating_q975"] - arena_dfs[dim].loc[model_name]["rating"])
|
| 180 |
lower_diff = round(arena_dfs[dim].loc[model_name]["rating"] - arena_dfs[dim].loc[model_name]["rating_q025"])
|
|
@@ -193,11 +196,11 @@ def get_arena_table(arena_dfs, model_table_df):
|
|
| 193 |
row.append(num_battles)
|
| 194 |
# Organization
|
| 195 |
# row.append(
|
| 196 |
-
# model_table_df[model_table_df["
|
| 197 |
# )
|
| 198 |
# # license
|
| 199 |
# row.append(
|
| 200 |
-
# model_table_df[model_table_df["
|
| 201 |
# )
|
| 202 |
|
| 203 |
values.append(row)
|
|
@@ -365,4 +368,4 @@ def build_leaderboard_tab(elo_results_file, leaderboard_table_file, show_plot=Fa
|
|
| 365 |
gr.Markdown(acknowledgment_md)
|
| 366 |
|
| 367 |
# return [md_1, plot_1, plot_2, plot_3, plot_4]
|
| 368 |
-
return [md_1]
|
|
|
|
| 40 |
"syncdreamer": "SyncDreamer",
|
| 41 |
"triplane-gaussian": "TriplaneGaussian",
|
| 42 |
"escher-net": "EscherNet",
|
| 43 |
+
"free3d": "Free3D",
|
| 44 |
+
"instant-mesh": "InstantMesh",
|
| 45 |
}
|
| 46 |
|
| 47 |
def replace_model_name(name, rank):
|
|
|
|
| 92 |
|
| 93 |
def load_leaderboard_table_csv(filename, add_hyperlink=True):
|
| 94 |
df = pd.read_csv(filename)
|
| 95 |
+
df = df.drop(df[df["Key"].isnull()].index)
|
| 96 |
for col in df.columns:
|
| 97 |
if "Elo rating" in col:
|
| 98 |
+
print(col, df[col], type(df[col]), df[col] is not np.NaN)
|
| 99 |
+
df[col] = df[col].apply(lambda x: int(x) if (x != "-" and pd.notna(x)) else np.NaN)
|
| 100 |
|
| 101 |
if add_hyperlink and col == "Model":
|
| 102 |
df[col] = df.apply(lambda row: model_hyperlink(row[col], row["Link"]), axis=1)
|
|
|
|
| 128 |
values = []
|
| 129 |
for i in range(len(model_table_df)):
|
| 130 |
row = []
|
| 131 |
+
model_key = model_table_df.iloc[i]["Key"]
|
| 132 |
model_name = model_table_df.iloc[i]["Model"]
|
| 133 |
# model display name
|
| 134 |
row.append(model_name)
|
|
|
|
| 162 |
for i in range(len(model_table_df)):
|
| 163 |
row = []
|
| 164 |
# model_key = arena_df.index[i]
|
| 165 |
+
# model_name = model_table_df[model_table_df["Key"] == model_key]["Model"].values[
|
| 166 |
# 0
|
| 167 |
# ]
|
| 168 |
+
model_name = model_table_df.iloc[i]["Key"]
|
| 169 |
|
| 170 |
# rank
|
| 171 |
row.append(i + 1)
|
|
|
|
| 174 |
# elo rating
|
| 175 |
num_battles = 0
|
| 176 |
for dim in arena_dfs.keys():
|
| 177 |
+
try:
|
| 178 |
+
print(arena_dfs[dim].loc[model_name])
|
| 179 |
+
except:
|
| 180 |
+
continue
|
| 181 |
row.append(round(arena_dfs[dim].loc[model_name]["rating"], 2))
|
| 182 |
upper_diff = round(arena_dfs[dim].loc[model_name]["rating_q975"] - arena_dfs[dim].loc[model_name]["rating"])
|
| 183 |
lower_diff = round(arena_dfs[dim].loc[model_name]["rating"] - arena_dfs[dim].loc[model_name]["rating_q025"])
|
|
|
|
| 196 |
row.append(num_battles)
|
| 197 |
# Organization
|
| 198 |
# row.append(
|
| 199 |
+
# model_table_df[model_table_df["Key"] == model_key]["Organization"].values[0]
|
| 200 |
# )
|
| 201 |
# # license
|
| 202 |
# row.append(
|
| 203 |
+
# model_table_df[model_table_df["Key"] == model_key]["License"].values[0]
|
| 204 |
# )
|
| 205 |
|
| 206 |
values.append(row)
|
|
|
|
| 368 |
gr.Markdown(acknowledgment_md)
|
| 369 |
|
| 370 |
# return [md_1, plot_1, plot_2, plot_3, plot_4]
|
| 371 |
+
return [md_1]
|