wentao commited on
Commit
fd5b4cf
·
1 Parent(s): e783f64
Files changed (2) hide show
  1. app.py +17 -2
  2. constants.py +1 -1
app.py CHANGED
@@ -1,3 +1,4 @@
 
1
  import gradio as gr
2
  import pandas as pd
3
  from utils import load_all_results
@@ -9,6 +10,18 @@ def filter_and_sort_leaderboard(category_filters, sort_by="Video-MME", descendin
9
  return filtered_df.sort_values(by=sort_by, ascending=not descending).reset_index(drop=True)
10
 
11
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  def build_interface():
13
  with gr.Blocks() as demo:
14
  gr.Markdown("## 🎥 LVU VLM Leaderboard")
@@ -23,7 +36,9 @@ def build_interface():
23
  transformer = gr.Checkbox(label="Open-source Transformer-based LMMs", value=True)
24
  efficient = gr.Checkbox(label="Open-source Efficient LMMs", value=True)
25
 
26
- leaderboard = gr.Dataframe(label="Leaderboard")
 
 
27
 
28
  def update_board(sort_by, descending, proprietary, transformer, efficient):
29
  filters = []
@@ -44,4 +59,4 @@ def build_interface():
44
 
45
  if __name__ == "__main__":
46
  demo = build_interface()
47
- demo.launch()
 
1
+ ### app.py
2
  import gradio as gr
3
  import pandas as pd
4
  from utils import load_all_results
 
10
  return filtered_df.sort_values(by=sort_by, ascending=not descending).reset_index(drop=True)
11
 
12
 
13
+ def style_rows_by_category(df):
14
+ # Apply light yellow/green/blue backgrounds for different categories
15
+ def row_style(row):
16
+ color_map = {
17
+ "Proprietary Models": "background-color: rgba(255, 255, 153, 0.3);", # light yellow
18
+ "Open-source Transformer-based LMMs": "background-color: rgba(153, 255, 204, 0.3);", # light green
19
+ "Open-source Efficient LMMs": "background-color: rgba(204, 229, 255, 0.3);" # light blue
20
+ }
21
+ return [color_map.get(row["Category"], "") for _ in row]
22
+ return df.style.apply(row_style, axis=1)
23
+
24
+
25
  def build_interface():
26
  with gr.Blocks() as demo:
27
  gr.Markdown("## 🎥 LVU VLM Leaderboard")
 
36
  transformer = gr.Checkbox(label="Open-source Transformer-based LMMs", value=True)
37
  efficient = gr.Checkbox(label="Open-source Efficient LMMs", value=True)
38
 
39
+ leaderboard = gr.Dataframe(label="Leaderboard", value=filter_and_sort_leaderboard(
40
+ ["Proprietary Models", "Open-source Transformer-based LMMs", "Open-source Efficient LMMs"], "Video-MME", True
41
+ ))
42
 
43
  def update_board(sort_by, descending, proprietary, transformer, efficient):
44
  filters = []
 
59
 
60
  if __name__ == "__main__":
61
  demo = build_interface()
62
+ demo.launch()
constants.py CHANGED
@@ -23,7 +23,7 @@ CATEGORY_MAP = {
23
 
24
  "LLaVA-Mini": ("7B", "Open-source Efficient LMMs"),
25
  "LongLLaVA": ("9B", "Open-source Efficient LMMs"),
26
- "LongVU": ("9B", "Open-source Efficient LMMs"),
27
  "Video-XL": ("7B", "Open-source Efficient LMMs"),
28
  "VAMBA": ("10B", "Open-source Efficient LMMs")
29
  }
 
23
 
24
  "LLaVA-Mini": ("7B", "Open-source Efficient LMMs"),
25
  "LongLLaVA": ("9B", "Open-source Efficient LMMs"),
26
+ "LongVU": ("7B", "Open-source Efficient LMMs"),
27
  "Video-XL": ("7B", "Open-source Efficient LMMs"),
28
  "VAMBA": ("10B", "Open-source Efficient LMMs")
29
  }