hexuan21 commited on
Commit
d27d2b3
β€’
1 Parent(s): 554697c
Files changed (2) hide show
  1. app.py +25 -2
  2. utils.py +71 -39
app.py CHANGED
@@ -49,8 +49,31 @@ with block:
49
  refresh_button.click(fn=refresh_data, outputs=data_component)
50
 
51
  # # Table 2
52
- # with gr.TabItem("πŸ“ About", elem_id="qa-tab-table2", id=2):
53
- # gr.Markdown(LEADERBORAD_INFO, elem_classes="markdown-text")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
 
55
 
56
  block.launch(share=True)
 
49
  refresh_button.click(fn=refresh_data, outputs=data_component)
50
 
51
  # # Table 2
52
+ with gr.TabItem("πŸ“Š EvalCrafter LeaderBoard (Best-of-K-Sampling with VideoScore)", elem_id="qa-tab-table2", id=2):
53
+ with gr.Row():
54
+ with gr.Accordion("Citation", open=False):
55
+ citation_button = gr.Textbox(
56
+ value=CITATION_BUTTON_TEXT,
57
+ label=CITATION_BUTTON_LABEL,
58
+ elem_id="citation-button",
59
+ lines=20,
60
+ )
61
+ gr.Markdown(
62
+ TABLE_INTRODUCTION
63
+ )
64
+ data_component=gr.components.Dataframe(
65
+ value=get_df_t2(),
66
+ headers=COLUMN_NAMES_T2,
67
+ type="pandas",
68
+ datatype=DATA_TITILE_TYPE_T2,
69
+ interactive=False,
70
+ visible=True,
71
+ elem_classes="table-class"
72
+ )
73
+
74
+ refresh_button = gr.Button("Refresh")
75
+ refresh_button.click(fn=refresh_data_t2, outputs=data_component)
76
+
77
 
78
 
79
  block.launch(share=True)
utils.py CHANGED
@@ -8,24 +8,6 @@ from huggingface_hub import Repository
8
 
9
  HF_TOKEN = os.environ.get("HUGGINGFACE_TOKEN")
10
 
11
- MODEL_INFO = [
12
- "Model",
13
- "Avg",
14
- "Visual Quality",
15
- "Temporal Consistency",
16
- "Dynamic Degree",
17
- "Text-to-Video Alignment",
18
- "Factual Consistency"
19
- ]
20
-
21
- DATA_TITILE_TYPE = ['markdown', 'number', 'number', 'number', 'number', 'number',]
22
-
23
- SUBMISSION_NAME = "VideoScore-Leaderboard"
24
- SUBMISSION_URL = os.path.join("https://huggingface.co/datasets/hexuan21/", SUBMISSION_NAME)
25
- CSV_DIR = "./VideoScore-Leaderboard/leaderboard_res.csv"
26
-
27
- COLUMN_NAMES = MODEL_INFO
28
-
29
  LEADERBORAD_INTRODUCTION = """# VideoScore Leaderboard
30
 
31
  πŸ† Welcome to the **VideoScore Leaderboard**! <br>
@@ -49,11 +31,78 @@ LEADERBORAD_INTRODUCTION = """# VideoScore Leaderboard
49
  <a href='https://hits.seeyoufarm.com'><img src='https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fhuggingface.co%2Fspaces%2FTIGER-Lab%2FVideoScore-Leaderboard&count_bg=%23C7C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=hits&edge_flat=false'></a>
50
  """
51
 
52
- TABLE_INTRODUCTION = """
53
- """
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
 
55
- LEADERBORAD_INFO = """
56
- """
57
 
58
  CITATION_BUTTON_LABEL = "Copy the following snippet to cite the t2v models and related papers"
59
  CITATION_BUTTON_TEXT = r"""
@@ -234,20 +283,3 @@ CITATION_BUTTON_TEXT = r"""
234
  }
235
 
236
  """
237
-
238
- def get_df():
239
- repo = Repository(local_dir=SUBMISSION_NAME, clone_from=SUBMISSION_URL, use_auth_token=HF_TOKEN)
240
- repo.git_pull()
241
- df = pd.read_csv(CSV_DIR)
242
- df['Model'] = df['Model'].apply(lambda x: f"[{x.split(']')[0][1:]}]({x.split('(')[1][:-1]})")
243
- df['Avg'] = df[["Visual Quality",
244
- "Temporal Consistency",
245
- "Dynamic Degree",
246
- "Text-to-Video Alignment",
247
- "Factual Consistency"]].mean(axis=1).round(2)
248
- df = df.sort_values(by=['Avg'], ascending=False)
249
- return df[COLUMN_NAMES]
250
-
251
-
252
- def refresh_data():
253
- return get_df()
 
8
 
9
  HF_TOKEN = os.environ.get("HUGGINGFACE_TOKEN")
10
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  LEADERBORAD_INTRODUCTION = """# VideoScore Leaderboard
12
 
13
  πŸ† Welcome to the **VideoScore Leaderboard**! <br>
 
31
  <a href='https://hits.seeyoufarm.com'><img src='https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fhuggingface.co%2Fspaces%2FTIGER-Lab%2FVideoScore-Leaderboard&count_bg=%23C7C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=hits&edge_flat=false'></a>
32
  """
33
 
34
+ SUBMISSION_NAME = "VideoScore-Leaderboard"
35
+ SUBMISSION_URL = os.path.join("https://huggingface.co/datasets/hexuan21/", SUBMISSION_NAME)
36
+
37
+
38
+
39
+ CSV_DIR = "./VideoScore-Leaderboard/leaderboard_res.csv"
40
+ COLUMN_NAMES = [
41
+ "Model",
42
+ "Avg",
43
+ "Visual Quality",
44
+ "Temporal Consistency",
45
+ "Dynamic Degree",
46
+ "Text-to-Video Alignment",
47
+ "Factual Consistency"
48
+ ]
49
+ DATA_TITILE_TYPE = ['markdown', 'number', 'number', 'number', 'number', 'number',]
50
+
51
+
52
+ CSV_DIR_T2="./VideoScore-Leaderboard/ec_res.csv"
53
+ COLUMN_NAMES_T2 = [
54
+ "Model",
55
+ "Avg",
56
+ "Visual Quality",
57
+ "Temporal Consistency",
58
+ "Motion Quality",
59
+ "Text-to-Video Alignment",
60
+ ]
61
+ DATA_TITILE_TYPE_T2 = ['markdown', 'number', 'number', 'number', 'number',]
62
+
63
+
64
+ TABLE_INTRODUCTION = """"""
65
+ LEADERBORAD_INFO = """"""
66
+
67
+
68
+ def get_df():
69
+ repo = Repository(local_dir=SUBMISSION_NAME, clone_from=SUBMISSION_URL, use_auth_token=HF_TOKEN)
70
+ repo.git_pull()
71
+ df = pd.read_csv(CSV_DIR)
72
+ df['Model'] = df['Model'].apply(lambda x: f"[{x.split(']')[0][1:]}]({x.split('(')[1][:-1]})")
73
+ df['Avg'] = df[["Visual Quality",
74
+ "Temporal Consistency",
75
+ "Dynamic Degree",
76
+ "Text-to-Video Alignment",
77
+ "Factual Consistency"]].mean(axis=1).round(2)
78
+ df = df.sort_values(by=['Avg'], ascending=False)
79
+ return df[COLUMN_NAMES]
80
+
81
+
82
+ def refresh_data():
83
+ return get_df()
84
+
85
+
86
+ def get_df_t2():
87
+ repo = Repository(local_dir=SUBMISSION_NAME, clone_from=SUBMISSION_URL, use_auth_token=HF_TOKEN)
88
+ repo.git_pull()
89
+ df = pd.read_csv(CSV_DIR_T2)
90
+ df['Model'] = df['Model'].apply(lambda x: f"[{x.split(']')[0][1:]}]({x.split('(')[1][:-1]})")
91
+ df['Avg'] = df[["Visual Quality",
92
+ "Temporal Consistency",
93
+ "Motion Quality",
94
+ "Text-to-Video Alignment",
95
+ ]].mean(axis=1).round(2)
96
+ df = df.sort_values(by=['Avg'], ascending=False)
97
+ return df[COLUMN_NAMES]
98
+
99
+
100
+ def refresh_data_t2():
101
+ return get_df_t2()
102
+
103
+
104
+
105
 
 
 
106
 
107
  CITATION_BUTTON_LABEL = "Copy the following snippet to cite the t2v models and related papers"
108
  CITATION_BUTTON_TEXT = r"""
 
283
  }
284
 
285
  """