Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -15,13 +15,19 @@ LEADERBORAD_INTRODUCTION = """# AutoEval-Video Leaderboard
|
|
15 |
"""
|
16 |
|
17 |
SUBMIT_INTRODUCTION = """# Submit Introduction
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
4. Click 'Refresh' to obtain the uploaded leaderboard.
|
23 |
-
5. The evaluation results of your model will be given in the "Overall Acc." box. For results specific to each evaluation dimension, please refer back to the leaderboard.
|
24 |
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
|
26 |
TABLE_INTRODUCTION = """The table below shows the performance of various models on different evaluation dimensions on AutoEval-Video.
|
27 |
We use accuracy(%) as the primary evaluation metric for each dimension.
|
@@ -118,6 +124,7 @@ def save_json(modelname, user_dict_list):
|
|
118 |
def add_new_eval(
|
119 |
input_file,
|
120 |
model_name_textbox: str,
|
|
|
121 |
):
|
122 |
if len(model_name_textbox) == 0:
|
123 |
return "Error! Empty model name!", get_result_df()
|
@@ -127,6 +134,7 @@ def add_new_eval(
|
|
127 |
else:
|
128 |
csv_data = pd.read_csv(CSV_DIR, dtype={'Model': str})
|
129 |
model_name_list = list(csv_data['Model'])
|
|
|
130 |
if model_name_textbox in model_name_list:
|
131 |
return "In the leaderboard, there already exists a model with the same name, and duplicate submissions of it are not allowed.", get_result_df()
|
132 |
|
@@ -151,7 +159,7 @@ def add_new_eval(
|
|
151 |
|
152 |
col = csv_data.shape[0]
|
153 |
new_data = [
|
154 |
-
model_name_textbox,
|
155 |
average_accuracy_video,
|
156 |
each_task_accuracy[id2questiontype[1]],
|
157 |
each_task_accuracy[id2questiontype[2]],
|
@@ -226,10 +234,14 @@ with block:
|
|
226 |
with gr.Row():
|
227 |
gr.Markdown(SUBMIT_INTRODUCTION, elem_classes="markdown-text")
|
228 |
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
|
|
|
|
|
|
|
|
233 |
)
|
234 |
|
235 |
with gr.Column():
|
@@ -243,6 +255,7 @@ with block:
|
|
243 |
inputs = [
|
244 |
input_file,
|
245 |
model_name_textbox,
|
|
|
246 |
],
|
247 |
outputs = [overall_acc, data_component],
|
248 |
)
|
|
|
15 |
"""
|
16 |
|
17 |
SUBMIT_INTRODUCTION = """# Submit Introduction
|
18 |
+
1. Format your model output as a JSON file, following the [example](https://github.com/Xiuyuan-Chen/AutoEval-Video/blob/main/prediction_sample.json) provided in our GitHub repository.
|
19 |
+
2. Assign a unique "model name" for your results.
|
20 |
+
3. Include the link to your model's repository with each submission.
|
21 |
+
4. After selecting 'Evaluation', allow approximately one hour for your model's results to be processed. To view the most recent results in the leaderboard, click 'Refresh'.
|
|
|
|
|
22 |
"""
|
23 |
+
# SUBMIT_INTRODUCTION = """# Submit Introduction
|
24 |
+
# For example, if you want to upload GPT-4V's result in the leaderboard, you need to:
|
25 |
+
# 1. Fill in 'GPT-4V' in 'Model Name' if it is your first time to submit your result. Alternatively, if you wish to modify the outcomes of your model, please add a version suffix after the model's name like 'GPT-4V_v2'.
|
26 |
+
# 2. Upload results.json.
|
27 |
+
# 3. Click the 'Evaluate' button.
|
28 |
+
# 4. Click 'Refresh' to obtain the uploaded leaderboard.
|
29 |
+
# 5. The evaluation results of your model will be given in the "Overall Acc." box. For results specific to each evaluation dimension, please refer back to the leaderboard.
|
30 |
+
# """
|
31 |
|
32 |
TABLE_INTRODUCTION = """The table below shows the performance of various models on different evaluation dimensions on AutoEval-Video.
|
33 |
We use accuracy(%) as the primary evaluation metric for each dimension.
|
|
|
124 |
def add_new_eval(
|
125 |
input_file,
|
126 |
model_name_textbox: str,
|
127 |
+
model_link: str
|
128 |
):
|
129 |
if len(model_name_textbox) == 0:
|
130 |
return "Error! Empty model name!", get_result_df()
|
|
|
134 |
else:
|
135 |
csv_data = pd.read_csv(CSV_DIR, dtype={'Model': str})
|
136 |
model_name_list = list(csv_data['Model'])
|
137 |
+
model_name_list = [name.split(']')[0][1:] for name in model_name_list]
|
138 |
if model_name_textbox in model_name_list:
|
139 |
return "In the leaderboard, there already exists a model with the same name, and duplicate submissions of it are not allowed.", get_result_df()
|
140 |
|
|
|
159 |
|
160 |
col = csv_data.shape[0]
|
161 |
new_data = [
|
162 |
+
'[' + model_name_textbox + '](' + model_link + ')',
|
163 |
average_accuracy_video,
|
164 |
each_task_accuracy[id2questiontype[1]],
|
165 |
each_task_accuracy[id2questiontype[2]],
|
|
|
234 |
with gr.Row():
|
235 |
gr.Markdown(SUBMIT_INTRODUCTION, elem_classes="markdown-text")
|
236 |
|
237 |
+
with gr.Row():
|
238 |
+
with gr.Column():
|
239 |
+
model_name_textbox = gr.Textbox(
|
240 |
+
label="Model name"
|
241 |
+
)
|
242 |
+
with gr.Column():
|
243 |
+
model_link = gr.Textbox(
|
244 |
+
label="Model Link"
|
245 |
)
|
246 |
|
247 |
with gr.Column():
|
|
|
255 |
inputs = [
|
256 |
input_file,
|
257 |
model_name_textbox,
|
258 |
+
model_link,
|
259 |
],
|
260 |
outputs = [overall_acc, data_component],
|
261 |
)
|