ftshijt commited on
Commit
a27decd
1 Parent(s): 6403334

Update src/populate.py

Browse files
Files changed (1) hide show
  1. src/populate.py +13 -0
src/populate.py CHANGED
@@ -1,6 +1,7 @@
1
  import json
2
  import os
3
 
 
4
  import pandas as pd
5
 
6
  from src.display.formatting import has_no_nan_values, make_clickable_model
@@ -16,6 +17,18 @@ def get_leaderboard_df(results_path: str, requests_path: str, cols: list, benchm
16
  # df = df.sort_values(by=[AutoEvalColumn.average.name], ascending=False)
17
  # df = df.sort_values(by=[AutoEvalColumn.task5.name], ascending=True)
18
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  mos_rank = df[AutoEvalColumn.task2.name].rank(method="max", numeric_only=True, ascending=True)
20
  bitrate_rank = df[AutoEvalColumn.task3.name].rank(method="min", numeric_only=True, ascending=True)
21
  df["Ranking"] = pd.Series((mos_rank + bitrate_rank)/2)
 
1
  import json
2
  import os
3
 
4
+ import numpy as np
5
  import pandas as pd
6
 
7
  from src.display.formatting import has_no_nan_values, make_clickable_model
 
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.task0.name] = pd.Series(
21
+ np.stack(
22
+ np.array(df[AutoEvalColumn.task2.name].values)
23
+ ).squeeze()
24
+ )
25
+ df[AutoEvalColumn.task1.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)