ftshijt commited on
Commit
e48fcaf
1 Parent(s): 25a3053

Update src/populate.py

Browse files
Files changed (1) hide show
  1. src/populate.py +8 -6
src/populate.py CHANGED
@@ -17,24 +17,26 @@ def get_leaderboard_df(results_path: str, requests_path: str, cols: list, benchm
17
  # df = df.sort_values(by=[AutoEvalColumn.average.name], ascending=False)
18
  # df = df.sort_values(by=[AutoEvalColumn.task5.name], ascending=True)
19
 
20
- df[AutoEvalColumn.task2.name] = pd.Series(
21
  np.stack(
22
- np.array(df[AutoEvalColumn.task2.name].values)
23
  ).squeeze()
24
  )
25
- df[AutoEvalColumn.task3.name] = pd.Series(
26
  np.stack(
27
- np.array(df[AutoEvalColumn.task3.name].values)
28
  ).squeeze()
29
  )
30
 
31
 
32
- mos_rank = df[AutoEvalColumn.task2.name].rank(method="max", numeric_only=True, ascending=True)
33
- bitrate_rank = df[AutoEvalColumn.task3.name].rank(method="min", numeric_only=True, ascending=True)
34
  df["Ranking"] = pd.Series((mos_rank + bitrate_rank)/2)
35
  df = df.sort_values(by=["Ranking", AutoEvalColumn.task2.name], ascending=True)
36
  df["Rank"] = df.groupby("Precision").cumcount() + 1
37
  df.pop("Ranking")
 
 
38
 
39
  df = df[cols].round(decimals=2)
40
 
 
17
  # df = df.sort_values(by=[AutoEvalColumn.average.name], ascending=False)
18
  # df = df.sort_values(by=[AutoEvalColumn.task5.name], ascending=True)
19
 
20
+ df[AutoEvalColumn.task3.name] = pd.Series(
21
  np.stack(
22
+ np.array(df[AutoEvalColumn.task3.name].values)
23
  ).squeeze()
24
  )
25
+ df[AutoEvalColumn.task4.name] = pd.Series(
26
  np.stack(
27
+ np.array(df[AutoEvalColumn.task4.name].values)
28
  ).squeeze()
29
  )
30
 
31
 
32
+ mos_rank = df[AutoEvalColumn.task3.name].rank(method="max", numeric_only=True, ascending=True)
33
+ bitrate_rank = df[AutoEvalColumn.task4.name].rank(method="min", numeric_only=True, ascending=True)
34
  df["Ranking"] = pd.Series((mos_rank + bitrate_rank)/2)
35
  df = df.sort_values(by=["Ranking", AutoEvalColumn.task2.name], ascending=True)
36
  df["Rank"] = df.groupby("Precision").cumcount() + 1
37
  df.pop("Ranking")
38
+
39
+ print(df)
40
 
41
  df = df[cols].round(decimals=2)
42