Spaces:
Sleeping
Sleeping
Peiran
commited on
Commit
·
bf7288d
1
Parent(s):
579bdeb
Fix indentation inside Blocks: move event bindings and controls under gr.Blocks context; py_compile passes
Browse files- __pycache__/app.cpython-311.pyc +0 -0
- app.py +99 -99
__pycache__/app.cpython-311.pyc
CHANGED
|
Binary files a/__pycache__/app.cpython-311.pyc and b/__pycache__/app.cpython-311.pyc differ
|
|
|
app.py
CHANGED
|
@@ -535,108 +535,108 @@ with gr.Blocks(title="VisArena Human Evaluation") as demo:
|
|
| 535 |
b_semantic_input = gr.Slider(1, 5, value=3, step=1, label="B: Semantic/Functional Alignment")
|
| 536 |
b_overall_input = gr.Slider(1, 5, value=3, step=1, label="B: Overall Photorealism")
|
| 537 |
|
| 538 |
-
submit_button = gr.Button("Submit Evaluation", variant="primary")
|
| 539 |
-
feedback_box = gr.Markdown("")
|
| 540 |
-
|
| 541 |
-
|
| 542 |
-
|
| 543 |
-
|
| 544 |
-
|
| 545 |
-
|
| 546 |
-
|
| 547 |
-
|
| 548 |
-
|
| 549 |
-
|
| 550 |
-
|
| 551 |
-
|
| 552 |
-
|
| 553 |
-
|
| 554 |
-
|
| 555 |
-
|
| 556 |
-
|
| 557 |
-
|
| 558 |
-
|
| 559 |
-
|
| 560 |
-
|
| 561 |
-
|
| 562 |
-
|
| 563 |
|
| 564 |
-
|
| 565 |
-
|
| 566 |
-
|
| 567 |
-
|
| 568 |
-
|
| 569 |
-
|
| 570 |
-
|
| 571 |
-
|
| 572 |
-
|
| 573 |
-
|
| 574 |
-
|
| 575 |
-
|
| 576 |
-
|
| 577 |
-
|
| 578 |
-
|
| 579 |
-
|
| 580 |
-
|
| 581 |
-
|
| 582 |
-
|
| 583 |
|
| 584 |
-
|
| 585 |
-
|
| 586 |
-
|
| 587 |
-
|
| 588 |
-
|
| 589 |
-
|
| 590 |
-
|
| 591 |
-
|
| 592 |
-
|
| 593 |
-
|
| 594 |
-
|
| 595 |
-
|
| 596 |
-
|
| 597 |
-
|
| 598 |
-
|
| 599 |
-
|
| 600 |
-
|
| 601 |
-
|
| 602 |
-
|
| 603 |
-
|
| 604 |
-
|
| 605 |
-
|
| 606 |
-
|
| 607 |
-
|
| 608 |
-
|
| 609 |
-
|
| 610 |
-
|
| 611 |
-
|
| 612 |
-
|
| 613 |
-
|
| 614 |
-
|
| 615 |
-
|
| 616 |
-
|
| 617 |
|
| 618 |
-
|
| 619 |
-
|
| 620 |
-
|
| 621 |
-
|
| 622 |
-
|
| 623 |
-
|
| 624 |
-
|
| 625 |
-
|
| 626 |
-
|
| 627 |
-
|
| 628 |
-
|
| 629 |
-
|
| 630 |
-
|
| 631 |
-
|
| 632 |
-
|
| 633 |
-
|
| 634 |
-
|
| 635 |
-
|
| 636 |
-
|
| 637 |
-
|
| 638 |
-
|
| 639 |
-
|
| 640 |
|
| 641 |
|
| 642 |
if __name__ == "__main__":
|
|
|
|
| 535 |
b_semantic_input = gr.Slider(1, 5, value=3, step=1, label="B: Semantic/Functional Alignment")
|
| 536 |
b_overall_input = gr.Slider(1, 5, value=3, step=1, label="B: Overall Photorealism")
|
| 537 |
|
| 538 |
+
submit_button = gr.Button("Submit Evaluation", variant="primary")
|
| 539 |
+
feedback_box = gr.Markdown("")
|
| 540 |
+
|
| 541 |
+
# Event bindings
|
| 542 |
+
task_selector.change(
|
| 543 |
+
fn=on_task_change,
|
| 544 |
+
inputs=[task_selector, pair_state],
|
| 545 |
+
outputs=[
|
| 546 |
+
pair_state,
|
| 547 |
+
index_slider,
|
| 548 |
+
pair_header,
|
| 549 |
+
orig_image,
|
| 550 |
+
model1_image,
|
| 551 |
+
model2_image,
|
| 552 |
+
a_physical_input,
|
| 553 |
+
a_optical_input,
|
| 554 |
+
a_semantic_input,
|
| 555 |
+
a_overall_input,
|
| 556 |
+
b_physical_input,
|
| 557 |
+
b_optical_input,
|
| 558 |
+
b_semantic_input,
|
| 559 |
+
b_overall_input,
|
| 560 |
+
feedback_box,
|
| 561 |
+
],
|
| 562 |
+
)
|
| 563 |
|
| 564 |
+
index_slider.release(
|
| 565 |
+
fn=on_pair_navigate,
|
| 566 |
+
inputs=[index_slider, pair_state],
|
| 567 |
+
outputs=[
|
| 568 |
+
index_slider,
|
| 569 |
+
pair_header,
|
| 570 |
+
orig_image,
|
| 571 |
+
model1_image,
|
| 572 |
+
model2_image,
|
| 573 |
+
a_physical_input,
|
| 574 |
+
a_optical_input,
|
| 575 |
+
a_semantic_input,
|
| 576 |
+
a_overall_input,
|
| 577 |
+
b_physical_input,
|
| 578 |
+
b_optical_input,
|
| 579 |
+
b_semantic_input,
|
| 580 |
+
b_overall_input,
|
| 581 |
+
],
|
| 582 |
+
)
|
| 583 |
|
| 584 |
+
submit_button.click(
|
| 585 |
+
fn=on_submit,
|
| 586 |
+
inputs=[
|
| 587 |
+
task_selector,
|
| 588 |
+
index_slider,
|
| 589 |
+
pair_state,
|
| 590 |
+
a_physical_input,
|
| 591 |
+
a_optical_input,
|
| 592 |
+
a_semantic_input,
|
| 593 |
+
a_overall_input,
|
| 594 |
+
b_physical_input,
|
| 595 |
+
b_optical_input,
|
| 596 |
+
b_semantic_input,
|
| 597 |
+
b_overall_input,
|
| 598 |
+
],
|
| 599 |
+
outputs=[
|
| 600 |
+
pair_state,
|
| 601 |
+
index_slider,
|
| 602 |
+
pair_header,
|
| 603 |
+
orig_image,
|
| 604 |
+
model1_image,
|
| 605 |
+
model2_image,
|
| 606 |
+
a_physical_input,
|
| 607 |
+
a_optical_input,
|
| 608 |
+
a_semantic_input,
|
| 609 |
+
a_overall_input,
|
| 610 |
+
b_physical_input,
|
| 611 |
+
b_optical_input,
|
| 612 |
+
b_semantic_input,
|
| 613 |
+
b_overall_input,
|
| 614 |
+
feedback_box,
|
| 615 |
+
],
|
| 616 |
+
)
|
| 617 |
|
| 618 |
+
# Auto-load default task on startup
|
| 619 |
+
demo.load(
|
| 620 |
+
fn=on_task_change,
|
| 621 |
+
inputs=[task_selector, pair_state],
|
| 622 |
+
outputs=[
|
| 623 |
+
pair_state,
|
| 624 |
+
index_slider,
|
| 625 |
+
pair_header,
|
| 626 |
+
orig_image,
|
| 627 |
+
model1_image,
|
| 628 |
+
model2_image,
|
| 629 |
+
a_physical_input,
|
| 630 |
+
a_optical_input,
|
| 631 |
+
a_semantic_input,
|
| 632 |
+
a_overall_input,
|
| 633 |
+
b_physical_input,
|
| 634 |
+
b_optical_input,
|
| 635 |
+
b_semantic_input,
|
| 636 |
+
b_overall_input,
|
| 637 |
+
feedback_box,
|
| 638 |
+
],
|
| 639 |
+
)
|
| 640 |
|
| 641 |
|
| 642 |
if __name__ == "__main__":
|