Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -237,6 +237,8 @@ def get_final_score_quality(df, selected_columns):
|
|
| 237 |
df.insert(1, 'Selected Score', selected_score)
|
| 238 |
return df
|
| 239 |
|
|
|
|
|
|
|
| 240 |
def get_baseline_df():
|
| 241 |
submission_repo = Repository(local_dir=SUBMISSION_NAME, clone_from=SUBMISSION_URL, use_auth_token=HF_TOKEN, repo_type="dataset")
|
| 242 |
submission_repo.git_pull()
|
|
@@ -270,6 +272,17 @@ def get_baseline_df_i2v():
|
|
| 270 |
df = convert_scores_to_percentage(df)
|
| 271 |
return df
|
| 272 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 273 |
def get_all_df(selected_columns, dir=CSV_DIR):
|
| 274 |
submission_repo = Repository(local_dir=SUBMISSION_NAME, clone_from=SUBMISSION_URL, use_auth_token=HF_TOKEN, repo_type="dataset")
|
| 275 |
submission_repo.git_pull()
|
|
@@ -294,6 +307,15 @@ def get_all_df_i2v(selected_columns, dir=I2V_DIR):
|
|
| 294 |
df = df.sort_values(by="Selected Score", ascending=False)
|
| 295 |
return df
|
| 296 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 297 |
def convert_scores_to_percentage(df):
|
| 298 |
# 对DataFrame中的每一列(除了'name'列)进行操作
|
| 299 |
|
|
@@ -318,6 +340,7 @@ def disable_all():
|
|
| 318 |
def enable_all():
|
| 319 |
return gr.update(value=TASK_INFO)
|
| 320 |
|
|
|
|
| 321 |
def on_filter_model_size_method_change(selected_columns):
|
| 322 |
updated_data = get_all_df(selected_columns, CSV_DIR)
|
| 323 |
#print(updated_data)
|
|
@@ -382,6 +405,25 @@ def on_filter_model_size_method_change_i2v(selected_columns):
|
|
| 382 |
)
|
| 383 |
return filter_component#.value
|
| 384 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 385 |
block = gr.Blocks()
|
| 386 |
|
| 387 |
|
|
@@ -436,6 +478,7 @@ with block:
|
|
| 436 |
disable_b.click(disable_all, inputs=None, outputs=[checkbox_group]).then(fn=on_filter_model_size_method_change, inputs=[ checkbox_group], outputs=data_component)
|
| 437 |
checkbox_group.change(fn=on_filter_model_size_method_change, inputs=[ checkbox_group], outputs=data_component)
|
| 438 |
|
|
|
|
| 439 |
with gr.TabItem("Video Quaity", elem_id="vbench-tab-table", id=2):
|
| 440 |
with gr.Accordion("INSTRUCTION", open=False):
|
| 441 |
citation_button = gr.Textbox(
|
|
@@ -464,7 +507,8 @@ with block:
|
|
| 464 |
)
|
| 465 |
|
| 466 |
checkbox_group_quality.change(fn=on_filter_model_size_method_change_quality, inputs=[checkbox_group_quality], outputs=data_component_quality)
|
| 467 |
-
|
|
|
|
| 468 |
with gr.TabItem("VBench-I2V", elem_id="vbench-tab-table", id=3):
|
| 469 |
with gr.Accordion("NOTE", open=False):
|
| 470 |
i2v_note_button = gr.Textbox(
|
|
@@ -493,13 +537,57 @@ with block:
|
|
| 493 |
)
|
| 494 |
|
| 495 |
checkbox_group_i2v.change(fn=on_filter_model_size_method_change_i2v, inputs=[checkbox_group_i2v], outputs=data_component_i2v)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 496 |
|
| 497 |
-
# table
|
| 498 |
-
with gr.TabItem("📝 About", elem_id="mvbench-tab-table", id=
|
| 499 |
gr.Markdown(LEADERBORAD_INFO, elem_classes="markdown-text")
|
| 500 |
|
| 501 |
-
# table
|
| 502 |
-
with gr.TabItem("🚀 Submit here! ", elem_id="mvbench-tab-table", id=
|
| 503 |
gr.Markdown(LEADERBORAD_INTRODUCTION, elem_classes="markdown-text")
|
| 504 |
|
| 505 |
with gr.Row():
|
|
|
|
| 237 |
df.insert(1, 'Selected Score', selected_score)
|
| 238 |
return df
|
| 239 |
|
| 240 |
+
|
| 241 |
+
|
| 242 |
def get_baseline_df():
|
| 243 |
submission_repo = Repository(local_dir=SUBMISSION_NAME, clone_from=SUBMISSION_URL, use_auth_token=HF_TOKEN, repo_type="dataset")
|
| 244 |
submission_repo.git_pull()
|
|
|
|
| 272 |
df = convert_scores_to_percentage(df)
|
| 273 |
return df
|
| 274 |
|
| 275 |
+
def get_baseline_df_long():
|
| 276 |
+
submission_repo = Repository(local_dir=SUBMISSION_NAME, clone_from=SUBMISSION_URL, use_auth_token=HF_TOKEN, repo_type="dataset")
|
| 277 |
+
submission_repo.git_pull()
|
| 278 |
+
df = pd.read_csv(LONG_DIR)
|
| 279 |
+
df = get_final_score(df, checkbox_group.value)
|
| 280 |
+
df = df.sort_values(by="Selected Score", ascending=False)
|
| 281 |
+
present_columns = MODEL_INFO + checkbox_group.value
|
| 282 |
+
df = df[present_columns]
|
| 283 |
+
df = convert_scores_to_percentage(df)
|
| 284 |
+
return df
|
| 285 |
+
|
| 286 |
def get_all_df(selected_columns, dir=CSV_DIR):
|
| 287 |
submission_repo = Repository(local_dir=SUBMISSION_NAME, clone_from=SUBMISSION_URL, use_auth_token=HF_TOKEN, repo_type="dataset")
|
| 288 |
submission_repo.git_pull()
|
|
|
|
| 307 |
df = df.sort_values(by="Selected Score", ascending=False)
|
| 308 |
return df
|
| 309 |
|
| 310 |
+
def get_all_df_long(selected_columns, dir=LONG_DIR):
|
| 311 |
+
submission_repo = Repository(local_dir=SUBMISSION_NAME, clone_from=SUBMISSION_URL, use_auth_token=HF_TOKEN, repo_type="dataset")
|
| 312 |
+
submission_repo.git_pull()
|
| 313 |
+
df = pd.read_csv(dir)
|
| 314 |
+
df = get_final_score(df, selected_columns)
|
| 315 |
+
df = df.sort_values(by="Selected Score", ascending=False)
|
| 316 |
+
return df
|
| 317 |
+
|
| 318 |
+
|
| 319 |
def convert_scores_to_percentage(df):
|
| 320 |
# 对DataFrame中的每一列(除了'name'列)进行操作
|
| 321 |
|
|
|
|
| 340 |
def enable_all():
|
| 341 |
return gr.update(value=TASK_INFO)
|
| 342 |
|
| 343 |
+
# select function
|
| 344 |
def on_filter_model_size_method_change(selected_columns):
|
| 345 |
updated_data = get_all_df(selected_columns, CSV_DIR)
|
| 346 |
#print(updated_data)
|
|
|
|
| 405 |
)
|
| 406 |
return filter_component#.value
|
| 407 |
|
| 408 |
+
def on_filter_model_size_method_change_long(selected_columns):
|
| 409 |
+
updated_data = get_all_df_long(selected_columns, LONG_DIR)
|
| 410 |
+
selected_columns = [item for item in TASK_INFO if item in selected_columns]
|
| 411 |
+
present_columns = MODEL_INFO + selected_columns
|
| 412 |
+
updated_data = updated_data[present_columns]
|
| 413 |
+
updated_data = updated_data.sort_values(by="Selected Score", ascending=False)
|
| 414 |
+
updated_data = convert_scores_to_percentage(updated_data)
|
| 415 |
+
updated_headers = present_columns
|
| 416 |
+
update_datatype = [DATA_TITILE_TYPE[COLUMN_NAMES.index(x)] for x in updated_headers]
|
| 417 |
+
filter_component = gr.components.Dataframe(
|
| 418 |
+
value=updated_data,
|
| 419 |
+
headers=updated_headers,
|
| 420 |
+
type="pandas",
|
| 421 |
+
datatype=update_datatype,
|
| 422 |
+
interactive=False,
|
| 423 |
+
visible=True,
|
| 424 |
+
)
|
| 425 |
+
return filter_component#.value
|
| 426 |
+
|
| 427 |
block = gr.Blocks()
|
| 428 |
|
| 429 |
|
|
|
|
| 478 |
disable_b.click(disable_all, inputs=None, outputs=[checkbox_group]).then(fn=on_filter_model_size_method_change, inputs=[ checkbox_group], outputs=data_component)
|
| 479 |
checkbox_group.change(fn=on_filter_model_size_method_change, inputs=[ checkbox_group], outputs=data_component)
|
| 480 |
|
| 481 |
+
# Table 1
|
| 482 |
with gr.TabItem("Video Quaity", elem_id="vbench-tab-table", id=2):
|
| 483 |
with gr.Accordion("INSTRUCTION", open=False):
|
| 484 |
citation_button = gr.Textbox(
|
|
|
|
| 507 |
)
|
| 508 |
|
| 509 |
checkbox_group_quality.change(fn=on_filter_model_size_method_change_quality, inputs=[checkbox_group_quality], outputs=data_component_quality)
|
| 510 |
+
|
| 511 |
+
# Table i2v
|
| 512 |
with gr.TabItem("VBench-I2V", elem_id="vbench-tab-table", id=3):
|
| 513 |
with gr.Accordion("NOTE", open=False):
|
| 514 |
i2v_note_button = gr.Textbox(
|
|
|
|
| 537 |
)
|
| 538 |
|
| 539 |
checkbox_group_i2v.change(fn=on_filter_model_size_method_change_i2v, inputs=[checkbox_group_i2v], outputs=data_component_i2v)
|
| 540 |
+
|
| 541 |
+
with gr.TabItem("📊 VBench-Long", elem_id="vbench-tab-table", id=4):
|
| 542 |
+
with gr.Row():
|
| 543 |
+
with gr.Accordion("INSTRUCTION", open=False):
|
| 544 |
+
citation_button = gr.Textbox(
|
| 545 |
+
value=LONG_CLAIM_TEXT,
|
| 546 |
+
label="",
|
| 547 |
+
elem_id="long-ins-button",
|
| 548 |
+
lines=2,
|
| 549 |
+
)
|
| 550 |
+
|
| 551 |
+
gr.Markdown(
|
| 552 |
+
TABLE_INTRODUCTION
|
| 553 |
+
)
|
| 554 |
+
with gr.Row():
|
| 555 |
+
with gr.Column(scale=0.2):
|
| 556 |
+
choosen_q_long = gr.Button("Select Quality Dimensions")
|
| 557 |
+
choosen_s_long = gr.Button("Select Semantic Dimensions")
|
| 558 |
+
enable_b_long = gr.Button("Select All")
|
| 559 |
+
disable_b_long = gr.Button("Deselect All")
|
| 560 |
+
|
| 561 |
+
with gr.Column(scale=0.8):
|
| 562 |
+
checkbox_group_long = gr.CheckboxGroup(
|
| 563 |
+
choices=TASK_INFO,
|
| 564 |
+
value=DEFAULT_INFO,
|
| 565 |
+
label="Evaluation Dimension",
|
| 566 |
+
interactive=True,
|
| 567 |
+
)
|
| 568 |
+
|
| 569 |
+
data_component = gr.components.Dataframe(
|
| 570 |
+
value=get_baseline_df_long,
|
| 571 |
+
headers=COLUMN_NAMES,
|
| 572 |
+
type="pandas",
|
| 573 |
+
datatype=DATA_TITILE_TYPE,
|
| 574 |
+
interactive=False,
|
| 575 |
+
visible=True,
|
| 576 |
+
height=700,
|
| 577 |
+
)
|
| 578 |
+
|
| 579 |
+
choosen_q_long.click(choose_all_quailty, inputs=None, outputs=[checkbox_group_long]).then(fn=on_filter_model_size_method_change_long, inputs=[ checkbox_group_long], outputs=data_component)
|
| 580 |
+
choosen_s_long.click(choose_all_semantic, inputs=None, outputs=[checkbox_group_long]).then(fn=on_filter_model_size_method_change_long, inputs=[ checkbox_group_long], outputs=data_component)
|
| 581 |
+
enable_b_long.click(enable_all, inputs=None, outputs=[checkbox_group_long]).then(fn=on_filter_model_size_method_change_long, inputs=[ checkbox_group_long], outputs=data_component)
|
| 582 |
+
disable_b_long.click(disable_all, inputs=None, outputs=[checkbox_group_long]).then(fn=on_filter_model_size_method_change_long, inputs=[ checkbox_group_long], outputs=data_component)
|
| 583 |
+
checkbox_group_long.change(fn=on_filter_model_size_method_change_long, inputs=[checkbox_group_long], outputs=data_component)
|
| 584 |
|
| 585 |
+
# table info
|
| 586 |
+
with gr.TabItem("📝 About", elem_id="mvbench-tab-table", id=5):
|
| 587 |
gr.Markdown(LEADERBORAD_INFO, elem_classes="markdown-text")
|
| 588 |
|
| 589 |
+
# table submission
|
| 590 |
+
with gr.TabItem("🚀 Submit here! ", elem_id="mvbench-tab-table", id=6):
|
| 591 |
gr.Markdown(LEADERBORAD_INTRODUCTION, elem_classes="markdown-text")
|
| 592 |
|
| 593 |
with gr.Row():
|