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

Reveal true model accuracies button.

Browse files
Files changed (1) hide show
  1. app.py +34 -1
app.py CHANGED
@@ -750,6 +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
 
754
  # Popup component
755
  with gr.Group(visible=True, elem_classes="popup-overlay") as popup_overlay:
@@ -862,9 +863,31 @@ with gr.Blocks(title="CODA: Wildlife Photo Classification Challenge",
862
  with gr.Column(scale=1):
863
  with gr.Group(elem_classes="panel-container"):
864
  acc_help_button = gr.Button("?", elem_classes="help-icon", size="sm")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
865
  accuracy_plot = gr.Plot(
866
  value=create_accuracy_chart(),
867
- show_label=False
 
868
  )
869
 
870
  # Status display with help button
@@ -1024,6 +1047,10 @@ with gr.Blocks(title="CODA: Wildlife Photo Classification Challenge",
1024
  def hide_species_guide_popup():
1025
  return gr.update(visible=False)
1026
 
 
 
 
 
1027
  popup_start_button.click(
1028
  fn=start_demo,
1029
  outputs=[image_display, status_with_help, model_predictions_display, prob_plot, accuracy_plot, popup_overlay, result_display, selection_help_button]
@@ -1075,6 +1102,12 @@ with gr.Blocks(title="CODA: Wildlife Photo Classification Challenge",
1075
  outputs=[selection_help_popup]
1076
  )
1077
 
 
 
 
 
 
 
1078
  # Species guide popup handlers
1079
  view_guide_button.click(
1080
  fn=show_species_guide_popup,
 
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:
 
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
 
1047
  def hide_species_guide_popup():
1048
  return gr.update(visible=False)
1049
 
1050
+ def reveal_accuracies():
1051
+ """Reveal accuracy plot and hide the title and button"""
1052
+ return gr.update(visible=True), gr.update(visible=False), gr.update(visible=False)
1053
+
1054
  popup_start_button.click(
1055
  fn=start_demo,
1056
  outputs=[image_display, status_with_help, model_predictions_display, prob_plot, accuracy_plot, popup_overlay, result_display, selection_help_button]
 
1102
  outputs=[selection_help_popup]
1103
  )
1104
 
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
1112
  view_guide_button.click(
1113
  fn=show_species_guide_popup,