Spaces:
Running
Running
v2 update
#42
by
MINGYISU
- opened
- app.py +37 -4
- labels_v2.py +39 -0
- results_v2.jsonl +1 -0
- utils.py +14 -25
app.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
from utils import *
|
|
|
|
| 2 |
|
| 3 |
global data_component
|
| 4 |
|
|
@@ -15,7 +16,7 @@ with gr.Blocks() as block:
|
|
| 15 |
|
| 16 |
with gr.Tabs(elem_classes="tab-buttons") as tabs:
|
| 17 |
# Table 1
|
| 18 |
-
with gr.TabItem("π MMEB", elem_id="qa-tab-table1", id=1):
|
| 19 |
with gr.Row():
|
| 20 |
with gr.Accordion("Citation", open=False):
|
| 21 |
citation_button = gr.Textbox(
|
|
@@ -52,7 +53,7 @@ with gr.Blocks() as block:
|
|
| 52 |
label="Maximum number of parameters (B)",
|
| 53 |
)
|
| 54 |
|
| 55 |
-
task_choices =
|
| 56 |
with gr.Row():
|
| 57 |
tasks_select = gr.CheckboxGroup(
|
| 58 |
choices=task_choices,
|
|
@@ -99,12 +100,44 @@ with gr.Blocks() as block:
|
|
| 99 |
refresh_button.click(fn=refresh_data, outputs=data_component)
|
| 100 |
|
| 101 |
# table 2
|
| 102 |
-
with gr.TabItem("π About", elem_id="qa-tab-table2", id=2):
|
| 103 |
gr.Markdown(LEADERBOARD_INFO, elem_classes="markdown-text")
|
| 104 |
|
| 105 |
# table 3
|
| 106 |
-
with gr.TabItem("π Submit here! ", elem_id="submit-tab", id=3):
|
| 107 |
with gr.Row():
|
| 108 |
gr.Markdown(SUBMIT_INTRODUCTION, elem_classes="markdown-text")
|
| 109 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 110 |
block.launch(share=True)
|
|
|
|
| 1 |
from utils import *
|
| 2 |
+
from labels_v2 import *
|
| 3 |
|
| 4 |
global data_component
|
| 5 |
|
|
|
|
| 16 |
|
| 17 |
with gr.Tabs(elem_classes="tab-buttons") as tabs:
|
| 18 |
# Table 1
|
| 19 |
+
with gr.TabItem("π MMEB-V1", elem_id="qa-tab-table1", id=1):
|
| 20 |
with gr.Row():
|
| 21 |
with gr.Accordion("Citation", open=False):
|
| 22 |
citation_button = gr.Textbox(
|
|
|
|
| 53 |
label="Maximum number of parameters (B)",
|
| 54 |
)
|
| 55 |
|
| 56 |
+
task_choices = TASKS
|
| 57 |
with gr.Row():
|
| 58 |
tasks_select = gr.CheckboxGroup(
|
| 59 |
choices=task_choices,
|
|
|
|
| 100 |
refresh_button.click(fn=refresh_data, outputs=data_component)
|
| 101 |
|
| 102 |
# table 2
|
| 103 |
+
with gr.TabItem("π About: MMEB-V1", elem_id="qa-tab-table2", id=2):
|
| 104 |
gr.Markdown(LEADERBOARD_INFO, elem_classes="markdown-text")
|
| 105 |
|
| 106 |
# table 3
|
| 107 |
+
with gr.TabItem("π Submit here for MMEB-V1! ", elem_id="submit-tab", id=3):
|
| 108 |
with gr.Row():
|
| 109 |
gr.Markdown(SUBMIT_INTRODUCTION, elem_classes="markdown-text")
|
| 110 |
|
| 111 |
+
# table 4
|
| 112 |
+
with gr.TabItem("π NEW! MMEB-V2", elem_id="qa-tab-table1", id=1):
|
| 113 |
+
with gr.Row():
|
| 114 |
+
with gr.Accordion("Citation", open=False):
|
| 115 |
+
citation_button = gr.Textbox(
|
| 116 |
+
value=CITATION_BUTTON_TEXT_V2,
|
| 117 |
+
label=CITATION_BUTTON_LABEL,
|
| 118 |
+
elem_id="citation-button",
|
| 119 |
+
lines=10,
|
| 120 |
+
)
|
| 121 |
+
gr.Markdown(TABLE_INTRODUCTION_V2)
|
| 122 |
+
|
| 123 |
+
df2 = get_df('results_v2.jsonl')
|
| 124 |
+
|
| 125 |
+
data_component_v2 = gr.components.Dataframe(
|
| 126 |
+
value=df2[COLUMN_NAMES_V2],
|
| 127 |
+
headers=COLUMN_NAMES_V2,
|
| 128 |
+
type="pandas",
|
| 129 |
+
datatype=DATA_TITLE_TYPE_V2,
|
| 130 |
+
interactive=False,
|
| 131 |
+
visible=True,
|
| 132 |
+
max_height=2400,
|
| 133 |
+
)
|
| 134 |
+
|
| 135 |
+
refresh_button2 = gr.Button("Refresh")
|
| 136 |
+
|
| 137 |
+
def update_with_tasks(*args):
|
| 138 |
+
return update_table(*args)
|
| 139 |
+
|
| 140 |
+
refresh_button2.click(fn=lambda: refresh_data('results_v2.jsonl', COLUMN_NAMES_V2), outputs=data_component_v2)
|
| 141 |
+
|
| 142 |
+
|
| 143 |
block.launch(share=True)
|
labels_v2.py
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
TASKS_V2 = ['V-CLS', 'V-QA', 'V-RET', 'V-MRET']
|
| 2 |
+
|
| 3 |
+
COLUMN_NAMES_V2 = [
|
| 4 |
+
"Rank", "Models", "Model Size(B)", "Data Source",
|
| 5 |
+
"V2-Overall",
|
| 6 |
+
"V-CLS", "V-QA", "V-RET", "V-MRET", "VisDoc"
|
| 7 |
+
]
|
| 8 |
+
|
| 9 |
+
BASE_COLS_V2 = [col for col in COLUMN_NAMES_V2 if col not in TASKS_V2]
|
| 10 |
+
|
| 11 |
+
DATA_TITLE_TYPE_V2 = ['number', 'markdown', 'str', 'markdown', 'number', 'number', 'number', 'number', 'number', 'number']
|
| 12 |
+
|
| 13 |
+
TABLE_INTRODUCTION_V2 = """MMEB-V2"""
|
| 14 |
+
|
| 15 |
+
CITATION_BUTTON_TEXT_V2 = r"""TBA"""
|
| 16 |
+
|
| 17 |
+
SUBMIT_INTRODUCTION_V2 = """# Submit on MMEB-V2 Leaderboard Introduction
|
| 18 |
+
|
| 19 |
+
## β Please note that you need to submit the JSON file with the following format:
|
| 20 |
+
```json
|
| 21 |
+
[
|
| 22 |
+
{
|
| 23 |
+
"Model": "<Model Name>",
|
| 24 |
+
<Optional>"URL": "<Model URL>",
|
| 25 |
+
"Model Size(B)": 1000,
|
| 26 |
+
"Data Source": Self-Reported,
|
| 27 |
+
"V2-Overall": 50.0,
|
| 28 |
+
"V-CLS": 50.0,
|
| 29 |
+
"V-QA": 50.0,
|
| 30 |
+
"V-RET": 50.0,
|
| 31 |
+
"V-MRET": 50.0,
|
| 32 |
+
"VisDoc": 50.0
|
| 33 |
+
},
|
| 34 |
+
]
|
| 35 |
+
```
|
| 36 |
+
You may refer to the Github page for instructions about evaluating your model.
|
| 37 |
+
Github link: https://github.com/TIGER-AI-Lab/VLM2Vec. \n
|
| 38 |
+
Please send us an email at m7su@uwaterloo.ca, attaching the JSON file. We will review your submission and update the leaderboard accordingly.
|
| 39 |
+
"""
|
results_v2.jsonl
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"Models":"Model","Model Size(B)":null,"Data Source":null,"V2-Overall":0,"V-CLS":0,"V-QA":0,"V-RET":0,"V-MRET":0,"VisDoc": 0, "URL":null}
|
utils.py
CHANGED
|
@@ -12,23 +12,16 @@ HF_TOKEN = os.environ.get("HF_TOKEN")
|
|
| 12 |
|
| 13 |
TASKS = ["Classification", "VQA", "Retrieval", "Grounding"]
|
| 14 |
|
| 15 |
-
|
| 16 |
"Rank", "Models", "Model Size(B)", "Data Source",
|
| 17 |
"Overall",
|
| 18 |
"Classification", "VQA", "Retrieval", "Grounding"
|
| 19 |
]
|
| 20 |
|
| 21 |
-
BASE_COLS = [col for col in
|
| 22 |
|
| 23 |
DATA_TITLE_TYPE = ['number', 'markdown', 'str', 'markdown', 'number', 'number', 'number', 'number', 'number', 'number', 'number']
|
| 24 |
|
| 25 |
-
SUBMISSION_NAME = "MMEB"
|
| 26 |
-
SUBMISSION_URL = os.path.join("https://huggingface.co/spaces/TIGER-Lab/", SUBMISSION_NAME)
|
| 27 |
-
FILE_NAME = "results.csv"
|
| 28 |
-
CSV_DIR = "results.csv"
|
| 29 |
-
|
| 30 |
-
COLUMN_NAMES = MODEL_INFO
|
| 31 |
-
|
| 32 |
LEADERBOARD_INTRODUCTION = """
|
| 33 |
# MMEB Leaderboard
|
| 34 |
|
|
@@ -45,7 +38,7 @@ Github link: https://github.com/TIGER-AI-Lab/VLM2Vec. \n
|
|
| 45 |
Overview: https://tiger-ai-lab.github.io/VLM2Vec/. \n
|
| 46 |
"""
|
| 47 |
|
| 48 |
-
TABLE_INTRODUCTION = """"""
|
| 49 |
|
| 50 |
LEADERBOARD_INFO = """
|
| 51 |
## Dataset Summary
|
|
@@ -78,7 +71,7 @@ CITATION_BUTTON_TEXT = r"""@article{jiang2024vlm2vec,
|
|
| 78 |
year={2024}
|
| 79 |
}"""
|
| 80 |
|
| 81 |
-
SUBMIT_INTRODUCTION = """# Submit on MMEB Leaderboard Introduction
|
| 82 |
|
| 83 |
## β Please note that you need to submit the JSON file with the following format:
|
| 84 |
```json
|
|
@@ -126,20 +119,17 @@ def fetch_data(file: str) -> pd.DataFrame:
|
|
| 126 |
|
| 127 |
def get_df(file="results.jsonl"):
|
| 128 |
df = fetch_data(file)
|
| 129 |
-
print(df.columns)
|
| 130 |
-
print('URL' in df.columns)
|
| 131 |
-
print(df)
|
| 132 |
df['Model Size(B)'] = df['Model Size(B)'].apply(process_model_size)
|
| 133 |
-
df = df.sort_values(by=['Overall'], ascending=False)
|
| 134 |
df = create_hyperlinked_names(df)
|
| 135 |
df['Rank'] = range(1, len(df) + 1)
|
| 136 |
return df
|
| 137 |
|
| 138 |
-
def refresh_data():
|
| 139 |
-
df = get_df()
|
| 140 |
-
return df[
|
| 141 |
|
| 142 |
-
def search_and_filter_models(df, query, min_size, max_size):
|
| 143 |
filtered_df = df.copy()
|
| 144 |
|
| 145 |
if query:
|
|
@@ -151,7 +141,7 @@ def search_and_filter_models(df, query, min_size, max_size):
|
|
| 151 |
|
| 152 |
filtered_df = filtered_df[size_mask]
|
| 153 |
|
| 154 |
-
return filtered_df[
|
| 155 |
|
| 156 |
|
| 157 |
def search_models(df, query):
|
|
@@ -176,9 +166,9 @@ def process_model_size(size):
|
|
| 176 |
return 'unknown'
|
| 177 |
|
| 178 |
|
| 179 |
-
def filter_columns_by_tasks(df, selected_tasks=None):
|
| 180 |
if selected_tasks is None or len(selected_tasks) == 0:
|
| 181 |
-
return df[
|
| 182 |
|
| 183 |
base_columns = ['Models', 'Model Size(B)', 'Data Source', 'Overall']
|
| 184 |
selected_columns = base_columns + selected_tasks
|
|
@@ -186,6 +176,5 @@ def filter_columns_by_tasks(df, selected_tasks=None):
|
|
| 186 |
available_columns = [col for col in selected_columns if col in df.columns]
|
| 187 |
return df[available_columns]
|
| 188 |
|
| 189 |
-
def get_task_choices():
|
| 190 |
-
return
|
| 191 |
-
|
|
|
|
| 12 |
|
| 13 |
TASKS = ["Classification", "VQA", "Retrieval", "Grounding"]
|
| 14 |
|
| 15 |
+
COLUMN_NAMES = [
|
| 16 |
"Rank", "Models", "Model Size(B)", "Data Source",
|
| 17 |
"Overall",
|
| 18 |
"Classification", "VQA", "Retrieval", "Grounding"
|
| 19 |
]
|
| 20 |
|
| 21 |
+
BASE_COLS = [col for col in COLUMN_NAMES if col not in TASKS]
|
| 22 |
|
| 23 |
DATA_TITLE_TYPE = ['number', 'markdown', 'str', 'markdown', 'number', 'number', 'number', 'number', 'number', 'number', 'number']
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
LEADERBOARD_INTRODUCTION = """
|
| 26 |
# MMEB Leaderboard
|
| 27 |
|
|
|
|
| 38 |
Overview: https://tiger-ai-lab.github.io/VLM2Vec/. \n
|
| 39 |
"""
|
| 40 |
|
| 41 |
+
TABLE_INTRODUCTION = """MMEB-V1"""
|
| 42 |
|
| 43 |
LEADERBOARD_INFO = """
|
| 44 |
## Dataset Summary
|
|
|
|
| 71 |
year={2024}
|
| 72 |
}"""
|
| 73 |
|
| 74 |
+
SUBMIT_INTRODUCTION = """# Submit on MMEB-V1 Leaderboard Introduction
|
| 75 |
|
| 76 |
## β Please note that you need to submit the JSON file with the following format:
|
| 77 |
```json
|
|
|
|
| 119 |
|
| 120 |
def get_df(file="results.jsonl"):
|
| 121 |
df = fetch_data(file)
|
|
|
|
|
|
|
|
|
|
| 122 |
df['Model Size(B)'] = df['Model Size(B)'].apply(process_model_size)
|
| 123 |
+
df = df.sort_values(by=[col for col in df.columns if 'Overall' in col], ascending=False)
|
| 124 |
df = create_hyperlinked_names(df)
|
| 125 |
df['Rank'] = range(1, len(df) + 1)
|
| 126 |
return df
|
| 127 |
|
| 128 |
+
def refresh_data(file='results.jsonl', column_names=COLUMN_NAMES):
|
| 129 |
+
df = get_df(file)
|
| 130 |
+
return df[column_names]
|
| 131 |
|
| 132 |
+
def search_and_filter_models(df, query, min_size, max_size, column_names=COLUMN_NAMES):
|
| 133 |
filtered_df = df.copy()
|
| 134 |
|
| 135 |
if query:
|
|
|
|
| 141 |
|
| 142 |
filtered_df = filtered_df[size_mask]
|
| 143 |
|
| 144 |
+
return filtered_df[column_names]
|
| 145 |
|
| 146 |
|
| 147 |
def search_models(df, query):
|
|
|
|
| 166 |
return 'unknown'
|
| 167 |
|
| 168 |
|
| 169 |
+
def filter_columns_by_tasks(df, selected_tasks=None, column_names=COLUMN_NAMES):
|
| 170 |
if selected_tasks is None or len(selected_tasks) == 0:
|
| 171 |
+
return df[column_names]
|
| 172 |
|
| 173 |
base_columns = ['Models', 'Model Size(B)', 'Data Source', 'Overall']
|
| 174 |
selected_columns = base_columns + selected_tasks
|
|
|
|
| 176 |
available_columns = [col for col in selected_columns if col in df.columns]
|
| 177 |
return df[available_columns]
|
| 178 |
|
| 179 |
+
def get_task_choices(tasks=TASKS):
|
| 180 |
+
return tasks
|
|
|