duongthienz commited on
Commit
6fe4bf8
·
verified ·
1 Parent(s): 4102890

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -18
app.py CHANGED
@@ -9,6 +9,7 @@ Responsibilities:
9
  """
10
 
11
  import os
 
12
  import tempfile
13
  from pathlib import Path
14
 
@@ -105,22 +106,22 @@ st.title("Instructor Support Tool")
105
  if not isGPU:
106
  st.warning("TOOL CURRENTLY USING CPU, ANALYSIS EXTREMELY SLOW")
107
 
108
- st.write(
109
- 'If you would like to see a sample result or multiple sample results generated from '
110
- 'real classroom audio, select "Single File Demo (Sample)", "Single File Demo (Full)", '
111
- 'or "Multiple Files Demo" on the left sidebar.'
112
- )
113
- st.markdown(
114
- "<p style='margin-bottom:4px;'>Keep in mind that this is a very early draft of the tool. "
115
- "Please be patient with any bugs/errors, and email Connor Young at "
116
- "<a href='mailto:czyoung@ualr.edu'>czyoung@ualr.edu</a> if you need help using the tool!</p>"
117
- "<p style='margin-top:16px; margin-bottom:0px;'>Would you like additional data, charts, or features? "
118
- "<a href='https://forms.gle/A32CdfGYSZoMPyyX9'>Tell us about our project!</a></p>"
119
- "<p style='margin-bottom:4px;'>If you would like to learn more or work with us, contact Dr. Mark Baillie at "
120
- "<a href='mailto:mtbaillie@ualr.edu'>mtbaillie@ualr.edu</a></p>"
121
- "<hr style='margin-top:16px; margin-bottom:16px;'>",
122
- unsafe_allow_html=True,
123
- )
124
 
125
  with st.expander("Instructions and additional details"):
126
  st.write("Thank you for viewing our experimental app! The overall presentations and features are expected to be improved over time.")
@@ -278,8 +279,12 @@ try:
278
  raw_to_display = {sp: _saved_renames.get(sp, sp) for sp in speakerNames}
279
  all_speakers_display = [raw_to_display[sp] for sp in speakerNames]
280
 
281
- catTypeColors = su.colorsCSS(3)
282
- allColors = su.colorsCSS(len(speakerNames) + len(st.session_state.categories))
 
 
 
 
283
  speakerColors = allColors[:len(speakerNames)]
284
  catColors = allColors[len(speakerNames):]
285
 
 
9
  """
10
 
11
  import os
12
+ import random
13
  import tempfile
14
  from pathlib import Path
15
 
 
106
  if not isGPU:
107
  st.warning("TOOL CURRENTLY USING CPU, ANALYSIS EXTREMELY SLOW")
108
 
109
+ with st.expander("TLDR"):
110
+ st.write(
111
+ 'If you would like to see a sample result or multiple sample results generated from '
112
+ 'real classroom audio, select "Single File Demo (Sample)", "Single File Demo (Full)", '
113
+ 'or "Multiple Files Demo" on the left sidebar.'
114
+ )
115
+ st.markdown(
116
+ "<p style='margin-bottom:4px;'>Keep in mind that this is a very early draft of the tool. "
117
+ "Please be patient with any bugs/errors, and email Connor Young at "
118
+ "<a href='mailto:czyoung@ualr.edu'>czyoung@ualr.edu</a> if you need help using the tool!</p>"
119
+ "<p style='margin-top:8px; margin-bottom:4px;'>Would you like additional data, charts, or features? "
120
+ "<a href='https://forms.gle/A32CdfGYSZoMPyyX9'>Tell us about our project!</a></p>"
121
+ "<p style='margin-bottom:4px;'>If you would like to learn more or work with us, contact Dr. Mark Baillie at "
122
+ "<a href='mailto:mtbaillie@ualr.edu'>mtbaillie@ualr.edu</a></p>",
123
+ unsafe_allow_html=True,
124
+ )
125
 
126
  with st.expander("Instructions and additional details"):
127
  st.write("Thank you for viewing our experimental app! The overall presentations and features are expected to be improved over time.")
 
279
  raw_to_display = {sp: _saved_renames.get(sp, sp) for sp in speakerNames}
280
  all_speakers_display = [raw_to_display[sp] for sp in speakerNames]
281
 
282
+ # Use a shared startingHue so both color pools step evenly from the same
283
+ # point, reducing the chance of similar adjacent colors.
284
+ _hue = int(random.random() * 180)
285
+ catTypeColors = utils.colorsCSS(3, startingHue=_hue)
286
+ allColors = utils.colorsCSS(len(speakerNames) + len(st.session_state.categories),
287
+ startingHue=_hue)
288
  speakerColors = allColors[:len(speakerNames)]
289
  catColors = allColors[len(speakerNames):]
290