justinkay commited on
Commit
04eb087
·
1 Parent(s): daf0675

Style for reveal box

Browse files
Files changed (1) hide show
  1. app.py +68 -34
app.py CHANGED
@@ -750,7 +750,7 @@ with gr.Blocks(title="CODA: Wildlife Photo Classification Challenge",
750
  """) as demo:
751
  # Main page title
752
  gr.Markdown("# CODA: Consensus-Driven Active Model Selection", elem_classes="text-center")
753
- gr.Markdown("Figure out which model is best by actively annotating data.", elem_classes="text-center")
754
 
755
  # Popup component
756
  with gr.Group(visible=True, elem_classes="popup-overlay") as popup_overlay:
@@ -861,34 +861,68 @@ with gr.Blocks(title="CODA: Wildlife Photo Classification Challenge",
861
  show_label=False
862
  )
863
  with gr.Column(scale=1):
864
- with gr.Group(elem_classes="panel-container"):
865
- acc_help_button = gr.Button("?", elem_classes="help-icon", size="sm")
866
-
867
- with gr.Row(elem_classes="flex-grow") as accuracy_title_row:
868
- gr.Markdown("""
869
- ## True Model Accuracies
870
-
871
- Click below to view the true model accuracies.
872
-
873
- Note you wouldn't be able to do this in the real model selection setting!
874
-
875
- """,
876
- elem_classes="text-center compact-predictions flex-grow")
877
-
878
- # Centered reveal button (initially visible)
879
- with gr.Group(visible=True) as accuracy_hidden_group:
880
- with gr.Column(elem_classes="flex items-center justify-center h-full"):
881
- reveal_accuracy_button = gr.Button(
882
- "Reveal model accuracies",
883
- variant="primary"
884
- )
885
-
886
- # Accuracy plot (initially hidden)
887
- accuracy_plot = gr.Plot(
888
- value=create_accuracy_chart(),
889
- show_label=False,
890
- visible=False
891
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
892
 
893
  # Status display with help button
894
  status_with_help = gr.HTML("", visible=True, elem_classes="status-text")
@@ -1082,10 +1116,10 @@ with gr.Blocks(title="CODA: Wildlife Photo Classification Challenge",
1082
  outputs=[prob_help_popup]
1083
  )
1084
 
1085
- acc_help_button.click(
1086
- fn=show_acc_help,
1087
- outputs=[acc_help_popup]
1088
- )
1089
 
1090
  acc_help_close.click(
1091
  fn=hide_acc_help,
@@ -1105,7 +1139,7 @@ with gr.Blocks(title="CODA: Wildlife Photo Classification Challenge",
1105
  # Reveal accuracy button handler
1106
  reveal_accuracy_button.click(
1107
  fn=reveal_accuracies,
1108
- outputs=[accuracy_plot, accuracy_hidden_group, accuracy_title_row]
1109
  )
1110
 
1111
  # Species guide popup handlers
 
750
  """) as demo:
751
  # Main page title
752
  gr.Markdown("# CODA: Consensus-Driven Active Model Selection", elem_classes="text-center")
753
+ gr.Markdown("*Figure out which model is best by actively annotating data.*", elem_classes="text-center")
754
 
755
  # Popup component
756
  with gr.Group(visible=True, elem_classes="popup-overlay") as popup_overlay:
 
861
  show_label=False
862
  )
863
  with gr.Column(scale=1):
864
+ # with gr.Group(elem_classes="panel-container"):
865
+ # acc_help_button = gr.Button("?", elem_classes="help-icon", size="sm")
866
+
867
+ # with gr.Row(elem_classes="flex-grow") as accuracy_title_row:
868
+ # gr.Markdown("""
869
+ # ## True Model Accuracies
870
+
871
+ # Click below to view the true model accuracies.
872
+
873
+ # Note you wouldn't be able to do this in the real model selection setting!
874
+
875
+ # """,
876
+ # elem_classes="text-center compact-predictions flex-grow")
877
+
878
+ # # Centered reveal button (initially visible)
879
+ # with gr.Group(visible=True) as accuracy_hidden_group:
880
+ # with gr.Column(elem_classes="flex items-center justify-center h-full"):
881
+ # reveal_accuracy_button = gr.Button(
882
+ # "Reveal model accuracies",
883
+ # variant="primary"
884
+ # )
885
+
886
+ # # Accuracy plot (initially hidden)
887
+ # accuracy_plot = gr.Plot(
888
+ # value=create_accuracy_chart(),
889
+ # show_label=False,
890
+ # visible=False
891
+ # )
892
+ accuracy_plot = gr.Plot(
893
+ value=create_accuracy_chart(),
894
+ show_label=False,
895
+ visible=False
896
+ )
897
+ with gr.Group(visible=True, elem_classes="subtle-outline") as hidden_group:
898
+ with gr.Column(elem_classes="flex items-center justify-center h-full"):
899
+ # Placeholder text when hidden (now first)
900
+ gr.HTML("<div style='margin-top: 2.9em;'></div>")
901
+ hidden_text0 = gr.Markdown("""
902
+ # True model performance is hidden
903
+ """,
904
+ elem_classes="text-center",)
905
+
906
+ gr.HTML("<div style='margin-top: 0.25em;'></div>")
907
+
908
+ hidden_text1 = gr.Markdown("""
909
+ In this problem setting the true model performance is assumed to be unknown (that is why we want to perform model selection!)
910
+
911
+ However, for this demo, we have computed the actual accuracies of each model in order to evaluate CODA's performance.
912
+
913
+ """,
914
+ elem_classes="text-center",
915
+ )
916
+ gr.HTML("<div style='margin-top: 0.25em;'></div>")
917
+
918
+ reveal_accuracy_button = gr.Button(
919
+ "🔍 Reveal True Model Accuracies",
920
+ variant="secondary",
921
+ size="lg"
922
+ )
923
+
924
+ gr.HTML("<div style='margin-top: 2.9em;'></div>")
925
+
926
 
927
  # Status display with help button
928
  status_with_help = gr.HTML("", visible=True, elem_classes="status-text")
 
1116
  outputs=[prob_help_popup]
1117
  )
1118
 
1119
+ # acc_help_button.click(
1120
+ # fn=show_acc_help,
1121
+ # outputs=[acc_help_popup]
1122
+ # )
1123
 
1124
  acc_help_close.click(
1125
  fn=hide_acc_help,
 
1139
  # Reveal accuracy button handler
1140
  reveal_accuracy_button.click(
1141
  fn=reveal_accuracies,
1142
+ outputs=[accuracy_plot, hidden_group]
1143
  )
1144
 
1145
  # Species guide popup handlers