nebulae09 commited on
Commit
8e5bfdb
·
1 Parent(s): feba5dc

update code with mmbench-video

Browse files
Files changed (2) hide show
  1. app.py +20 -2
  2. lb_info.py +1 -1
app.py CHANGED
@@ -102,12 +102,21 @@ with gr.Blocks() as demo:
102
  label='Model Type',
103
  interactive=True
104
  )
 
 
 
 
 
 
 
105
  s.data_component = gr.components.DataFrame(
106
  value=s.table[s.headers],
107
  type="pandas",
108
  datatype=[s.type_map[x] for x in s.headers],
109
  interactive=False,
110
- visible=True)
 
 
111
  s.dataset = gr.Textbox(value=dataset, label=dataset, visible=False)
112
 
113
  def filter_df_l2(dataset_name, fields, model_size, model_type):
@@ -122,12 +131,21 @@ with gr.Blocks() as demo:
122
  df = df[df['flag']]
123
  df.pop('flag')
124
 
 
 
 
 
 
 
 
125
  comp = gr.components.DataFrame(
126
  value=df[headers],
127
  type="pandas",
128
  datatype=[s.type_map[x] for x in headers],
129
  interactive=False,
130
- visible=True)
 
 
131
  return comp
132
 
133
  for cbox in [s.checkbox_group, s.model_size, s.model_type]:
 
102
  label='Model Type',
103
  interactive=True
104
  )
105
+ # Adjust column width if dataset is MMBench-Video
106
+ if dataset == "MMBench-Video":
107
+ column_widths = {col: 200 for col in headers} # Default width
108
+ column_widths['Method'] = 400 # Adjust Method column width
109
+ else:
110
+ column_widths = None
111
+
112
  s.data_component = gr.components.DataFrame(
113
  value=s.table[s.headers],
114
  type="pandas",
115
  datatype=[s.type_map[x] for x in s.headers],
116
  interactive=False,
117
+ visible=True,
118
+ column_widths=column_widths
119
+ )
120
  s.dataset = gr.Textbox(value=dataset, label=dataset, visible=False)
121
 
122
  def filter_df_l2(dataset_name, fields, model_size, model_type):
 
131
  df = df[df['flag']]
132
  df.pop('flag')
133
 
134
+ # Adjust column width if dataset is MMBench-Video
135
+ if dataset_name == "MMBench-Video":
136
+ column_widths = {col: 200 for col in headers} # Default width
137
+ column_widths['Method'] = 400 # Adjust Method column width
138
+ else:
139
+ column_widths = None
140
+
141
  comp = gr.components.DataFrame(
142
  value=df[headers],
143
  type="pandas",
144
  datatype=[s.type_map[x] for x in headers],
145
  interactive=False,
146
+ visible=True,
147
+ column_widths=column_widths
148
+ )
149
  return comp
150
 
151
  for cbox in [s.checkbox_group, s.model_size, s.model_type]:
lb_info.py CHANGED
@@ -13,7 +13,7 @@ def listinstr(lst, s):
13
  return False
14
 
15
  # CONSTANTS-URL
16
- # RESULT_FILE = '../video_leaderboard_result_final.json'
17
  URL = "http://opencompass.openxlab.space/utils/video_leaderboard.json"
18
  VLMEVALKIT_README = 'https://raw.githubusercontent.com/open-compass/VLMEvalKit/main/README.md'
19
  # CONSTANTS-CITATION
 
13
  return False
14
 
15
  # CONSTANTS-URL
16
+ # RESULT_FILE = '../video_leaderboard.json'
17
  URL = "http://opencompass.openxlab.space/utils/video_leaderboard.json"
18
  VLMEVALKIT_README = 'https://raw.githubusercontent.com/open-compass/VLMEvalKit/main/README.md'
19
  # CONSTANTS-CITATION