Spaces:
Running
Running
fix: 분반 정보 업데이트
Browse files
app.py
CHANGED
|
@@ -565,95 +565,119 @@ def create_interface():
|
|
| 565 |
outputs=[result_output_challenge, leaderboard_output_challenge]
|
| 566 |
)
|
| 567 |
|
| 568 |
-
# Originality반 탭
|
| 569 |
-
with gr.Tab("🎨 Originality반"):
|
| 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 |
-
# BCE반 탭
|
| 608 |
-
with gr.Tab("🔥 BCE반"):
|
| 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 |
-
|
| 643 |
-
|
| 644 |
-
|
| 645 |
|
| 646 |
# 페이지 로드 시 모든 리더보드 표시
|
| 647 |
demo.load(
|
| 648 |
-
fn=lambda: (
|
| 649 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 650 |
)
|
| 651 |
|
| 652 |
# 실시간 업데이트 (10초마다 - 모든 탭 업데이트)
|
| 653 |
timer = gr.Timer(value=10)
|
| 654 |
timer.tick(
|
| 655 |
-
fn=lambda: (
|
| 656 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 657 |
)
|
| 658 |
|
| 659 |
return demo
|
|
|
|
| 565 |
outputs=[result_output_challenge, leaderboard_output_challenge]
|
| 566 |
)
|
| 567 |
|
| 568 |
+
# # Originality반 탭
|
| 569 |
+
# with gr.Tab("🎨 Originality반"):
|
| 570 |
+
# with gr.Row():
|
| 571 |
+
# with gr.Column(scale=1):
|
| 572 |
+
# gr.Markdown("### 📤 이미지 업로드 (Originality반)")
|
| 573 |
+
# image_input_originality = gr.Image(
|
| 574 |
+
# label="비교할 이미지를 업로드하세요",
|
| 575 |
+
# type="pil",
|
| 576 |
+
# height=300
|
| 577 |
+
# )
|
| 578 |
+
# username_input_originality = gr.Textbox(
|
| 579 |
+
# label="사용자 이름",
|
| 580 |
+
# placeholder="이름을 입력하세요",
|
| 581 |
+
# max_lines=1
|
| 582 |
+
# )
|
| 583 |
+
# submit_btn_originality = gr.Button("🚀 점수 계산 및 등록", variant="primary", size="lg")
|
| 584 |
+
|
| 585 |
+
# with gr.Column(scale=1):
|
| 586 |
+
# gr.Markdown("### 📊 결과 (Originality반)")
|
| 587 |
+
# result_output_originality = gr.Textbox(
|
| 588 |
+
# label="계산 결과",
|
| 589 |
+
# lines=10,
|
| 590 |
+
# interactive=False
|
| 591 |
+
# )
|
| 592 |
+
|
| 593 |
+
# gr.Markdown("### 🏅 Originality반 리더보드")
|
| 594 |
+
# leaderboard_output_originality = gr.Dataframe(
|
| 595 |
+
# headers=["순위", "사용자명", "점수", "날짜"],
|
| 596 |
+
# datatype=["number", "str", "number", "str"],
|
| 597 |
+
# interactive=False
|
| 598 |
+
# )
|
| 599 |
+
|
| 600 |
+
# # Originality반 이벤트 핸들러
|
| 601 |
+
# submit_btn_originality.click(
|
| 602 |
+
# fn=process_user_image_originality,
|
| 603 |
+
# inputs=[image_input_originality, username_input_originality],
|
| 604 |
+
# outputs=[result_output_originality, leaderboard_output_originality]
|
| 605 |
+
# )
|
| 606 |
+
|
| 607 |
+
# # BCE반 탭
|
| 608 |
+
# with gr.Tab("🔥 BCE반"):
|
| 609 |
+
# with gr.Row():
|
| 610 |
+
# with gr.Column(scale=1):
|
| 611 |
+
# gr.Markdown("### 📤 이미지 업로드 (BCE반)")
|
| 612 |
+
# image_input_bce = gr.Image(
|
| 613 |
+
# label="비교할 이미지를 업로드하세요",
|
| 614 |
+
# type="pil",
|
| 615 |
+
# height=300
|
| 616 |
+
# )
|
| 617 |
+
# username_input_bce = gr.Textbox(
|
| 618 |
+
# label="사용자 이름",
|
| 619 |
+
# placeholder="이름을 입력하세요",
|
| 620 |
+
# max_lines=1
|
| 621 |
+
# )
|
| 622 |
+
# submit_btn_bce = gr.Button("🚀 점수 계산 및 등록", variant="primary", size="lg")
|
| 623 |
+
|
| 624 |
+
# with gr.Column(scale=1):
|
| 625 |
+
# gr.Markdown("### 📊 결과 (BCE반)")
|
| 626 |
+
# result_output_bce = gr.Textbox(
|
| 627 |
+
# label="계산 결과",
|
| 628 |
+
# lines=10,
|
| 629 |
+
# interactive=False
|
| 630 |
+
# )
|
| 631 |
+
|
| 632 |
+
# gr.Markdown("### 🏅 BCE반 리더보드")
|
| 633 |
+
# leaderboard_output_bce = gr.Dataframe(
|
| 634 |
+
# headers=["순위", "사용자명", "점수", "날짜"],
|
| 635 |
+
# datatype=["number", "str", "number", "str"],
|
| 636 |
+
# interactive=False
|
| 637 |
+
# )
|
| 638 |
+
|
| 639 |
+
# # BCE반 이벤트 핸들러
|
| 640 |
+
# submit_btn_bce.click(
|
| 641 |
+
# fn=process_user_image_bce,
|
| 642 |
+
# inputs=[image_input_bce, username_input_bce],
|
| 643 |
+
# outputs=[result_output_bce, leaderboard_output_bce]
|
| 644 |
+
# )
|
| 645 |
|
| 646 |
# 페이지 로드 시 모든 리더보드 표시
|
| 647 |
demo.load(
|
| 648 |
+
fn=lambda: (
|
| 649 |
+
get_current_leaderboard_practice(),
|
| 650 |
+
get_current_leaderboard_respect(),
|
| 651 |
+
get_current_leaderboard_challenge(),
|
| 652 |
+
# get_current_leaderboard_originality(),
|
| 653 |
+
# get_current_leaderboard_bce()
|
| 654 |
+
),
|
| 655 |
+
outputs=[
|
| 656 |
+
leaderboard_output_practice,
|
| 657 |
+
leaderboard_output_respect,
|
| 658 |
+
leaderboard_output_challenge,
|
| 659 |
+
# leaderboard_output_originality,
|
| 660 |
+
# leaderboard_output_bce,
|
| 661 |
+
]
|
| 662 |
)
|
| 663 |
|
| 664 |
# 실시간 업데이트 (10초마다 - 모든 탭 업데이트)
|
| 665 |
timer = gr.Timer(value=10)
|
| 666 |
timer.tick(
|
| 667 |
+
fn=lambda: (
|
| 668 |
+
get_current_leaderboard_practice(),
|
| 669 |
+
get_current_leaderboard_respect(),
|
| 670 |
+
get_current_leaderboard_challenge(),
|
| 671 |
+
# get_current_leaderboard_originality(),
|
| 672 |
+
# get_current_leaderboard_bce()
|
| 673 |
+
),
|
| 674 |
+
outputs=[
|
| 675 |
+
leaderboard_output_practice,
|
| 676 |
+
leaderboard_output_respect,
|
| 677 |
+
leaderboard_output_challenge,
|
| 678 |
+
# leaderboard_output_originality,
|
| 679 |
+
# leaderboard_output_bce,
|
| 680 |
+
]
|
| 681 |
)
|
| 682 |
|
| 683 |
return demo
|