duongthienz commited on
Commit
14b9c76
·
verified ·
1 Parent(s): 8941973

Update minor visual stuff

Browse files
Files changed (1) hide show
  1. app.py +34 -17
app.py CHANGED
@@ -92,15 +92,26 @@ if not isGPU:
92
  st.warning("TOOL CURRENTLY USING CPU, ANALYSIS EXTREMELY SLOW")
93
 
94
  st.write(
95
- 'If you would like to see a sample result generated from real classroom audio, '
96
- 'use the sidebar on the left and press "Load Demo Example"'
 
97
  )
98
- st.write(
99
- "Keep in mind that this is a very early draft of the tool. "
100
  "Please be patient with any bugs/errors, and email Connor Young at "
101
- "czyoung@ualr.edu if you need help using the tool!"
 
 
 
 
 
 
 
 
 
 
 
102
  )
103
- st.divider()
104
 
105
  with st.expander("Instructions and additional details"):
106
  st.write(
@@ -124,12 +135,6 @@ with st.expander("Instructions and additional details"):
124
  "[More examples](https://plotly.com/python/basic-charts/)."
125
  )
126
 
127
- st.write(
128
- "Would you like additional data, charts, or features? "
129
- "[Tell us about our project!](https://forms.gle/A32CdfGYSZoMPyyX9)"
130
- )
131
- st.write("If you would like to learn more or work with us, contact Dr. Mark Baillie at mtbaillie@ualr.edu")
132
-
133
  # ---------------------------------------------------------------------------
134
  # File upload
135
  # ---------------------------------------------------------------------------
@@ -280,6 +285,8 @@ currFile = st.sidebar.selectbox(
280
  if isDemo:
281
  currFile = file_names[0]
282
 
 
 
283
  if currFile is None:
284
  st.write("Select a file to view from the sidebar")
285
 
@@ -349,7 +356,7 @@ try:
349
  on_click=removeCategory, args=(i,),
350
  )
351
 
352
- st.sidebar.text_input("Add category", key="categoryInput", on_change=addCategory)
353
 
354
  # -----------------------------------------------------------------------
355
  # Sidebar — rename speakers
@@ -357,9 +364,12 @@ try:
357
 
358
  st.sidebar.divider()
359
  st.sidebar.subheader("Rename Speakers")
360
- st.sidebar.caption(
 
361
  "Assign a name and select which speaker labels (across all files) it applies to. "
362
- "Changes apply to all matched speakers instantly."
 
 
363
  )
364
 
365
 
@@ -489,7 +499,7 @@ try:
489
  rendered_clip_for: set = set()
490
 
491
  # ~52px per row gives roughly 10 visible rows before scrolling
492
- with st.container(height=520, border=False):
493
  for _, row in tableDF.iterrows():
494
  row_cols = st.columns(col_widths)
495
  display_sp = row["Speaker"]
@@ -622,4 +632,11 @@ with st.expander("(Potentially) FAQ"):
622
  st.write("**4. I want to view my previously analyzed data. How?**")
623
  st.write("Download a CSV copy from the Data tab and re-upload it later.")
624
  st.write("**5. The app is extremely slow. What is wrong?**")
625
- st.write("We are securing funding for permanent GPU access. Until then, CPU analysis may take a very long time.")
 
 
 
 
 
 
 
 
92
  st.warning("TOOL CURRENTLY USING CPU, ANALYSIS EXTREMELY SLOW")
93
 
94
  st.write(
95
+ 'If you would like to see a sample result or multiple sample results generated from '
96
+ 'real classroom audio, '
97
+ 'select "Single File Demo" or "Multiple Files Demo" on the left sidebar.'
98
  )
99
+ st.markdown(
100
+ "<p style='margin-bottom:4px;'>Keep in mind that this is a very early draft of the tool. "
101
  "Please be patient with any bugs/errors, and email Connor Young at "
102
+ "czyoung@ualr.edu if you need help using the tool!</p>"
103
+ "<hr style='margin-top:4px; margin-bottom:8px;'>",
104
+ unsafe_allow_html=True,
105
+ )
106
+
107
+ st.markdown(
108
+ "<style>"
109
+ "details > summary { font-size: 1rem; font-weight: 500; }"
110
+ ".stTabs [data-baseweb='tab'] { font-size: 1rem; }"
111
+ ".stFileUploader label { font-size: 1rem; }"
112
+ "</style>",
113
+ unsafe_allow_html=True,
114
  )
 
115
 
116
  with st.expander("Instructions and additional details"):
117
  st.write(
 
135
  "[More examples](https://plotly.com/python/basic-charts/)."
136
  )
137
 
 
 
 
 
 
 
138
  # ---------------------------------------------------------------------------
139
  # File upload
140
  # ---------------------------------------------------------------------------
 
285
  if isDemo:
286
  currFile = file_names[0]
287
 
288
+ st.sidebar.divider()
289
+
290
  if currFile is None:
291
  st.write("Select a file to view from the sidebar")
292
 
 
356
  on_click=removeCategory, args=(i,),
357
  )
358
 
359
+ st.sidebar.text_input("Add Category", key="categoryInput", on_change=addCategory)
360
 
361
  # -----------------------------------------------------------------------
362
  # Sidebar — rename speakers
 
364
 
365
  st.sidebar.divider()
366
  st.sidebar.subheader("Rename Speakers")
367
+ st.sidebar.markdown(
368
+ "<p style='font-size:0.85rem; color:gray; margin-bottom:2px;'>"
369
  "Assign a name and select which speaker labels (across all files) it applies to. "
370
+ "Changes apply to all matched speakers instantly.</p>"
371
+ "<hr style='margin-top:2px; margin-bottom:6px;'>",
372
+ unsafe_allow_html=True,
373
  )
374
 
375
 
 
499
  rendered_clip_for: set = set()
500
 
501
  # ~52px per row gives roughly 10 visible rows before scrolling
502
+ with st.container(height=480, border=False):
503
  for _, row in tableDF.iterrows():
504
  row_cols = st.columns(col_widths)
505
  display_sp = row["Speaker"]
 
632
  st.write("**4. I want to view my previously analyzed data. How?**")
633
  st.write("Download a CSV copy from the Data tab and re-upload it later.")
634
  st.write("**5. The app is extremely slow. What is wrong?**")
635
+ st.write("We are securing funding for permanent GPU access. Until then, CPU analysis may take a very long time.")
636
+
637
+ st.divider()
638
+ st.write(
639
+ "Would you like additional data, charts, or features? "
640
+ "[Tell us about our project!](https://forms.gle/A32CdfGYSZoMPyyX9)"
641
+ )
642
+ st.write("If you would like to learn more or work with us, contact Dr. Mark Baillie at mtbaillie@ualr.edu")