Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -341,7 +341,8 @@ if 'showSummary' not in st.session_state:
|
|
| 341 |
st.title("Instructor Support Tool")
|
| 342 |
if not isGPU:
|
| 343 |
st.warning("TOOL CURRENTLY USING CPU, ANALYSIS EXTREMELY SLOW")
|
| 344 |
-
|
|
|
|
| 345 |
uploaded_file_paths = st.file_uploader("Upload an audio of classroom activity to analyze", accept_multiple_files=True)
|
| 346 |
|
| 347 |
supported_file_types = ('.wav','.mp3','.mp4','.txt','.rttm','.csv')
|
|
@@ -515,6 +516,21 @@ if st.sidebar.button("Load Demo Example"):
|
|
| 515 |
file_names=[sampleUpload.name]
|
| 516 |
start_time = time.time()
|
| 517 |
st.session_state.file_names = file_names
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 518 |
with st.spinner(text=f'Loading Demo Sample'):
|
| 519 |
# RTTM load as filler
|
| 520 |
speakerList, annotations = su.loadAudioRTTM(file_paths[0])
|
|
|
|
| 341 |
st.title("Instructor Support Tool")
|
| 342 |
if not isGPU:
|
| 343 |
st.warning("TOOL CURRENTLY USING CPU, ANALYSIS EXTREMELY SLOW")
|
| 344 |
+
st.write('If you would like to see a sample result generated from real classroom audio, use the sidebar on the left and press "Load Demo Example"')
|
| 345 |
+
st.write('Keep in mind that this is a very early draft of the tool. Please be patient with any bugs/errors, and email czyoung@ualr.edu if you need help using the tool!')
|
| 346 |
uploaded_file_paths = st.file_uploader("Upload an audio of classroom activity to analyze", accept_multiple_files=True)
|
| 347 |
|
| 348 |
supported_file_types = ('.wav','.mp3','.mp4','.txt','.rttm','.csv')
|
|
|
|
| 516 |
file_names=[sampleUpload.name]
|
| 517 |
start_time = time.time()
|
| 518 |
st.session_state.file_names = file_names
|
| 519 |
+
# Save valid file names
|
| 520 |
+
if len(valid_files) > 0:
|
| 521 |
+
file_names = [f.name for f in valid_files]
|
| 522 |
+
while (len(st.session_state.results) < len(valid_files)):
|
| 523 |
+
st.session_state.results.append([])
|
| 524 |
+
while (len(st.session_state.summaries) < len(valid_files)):
|
| 525 |
+
st.session_state.summaries.append([])
|
| 526 |
+
while (len(st.session_state.unusedSpeakers) < len(valid_files)):
|
| 527 |
+
st.session_state.unusedSpeakers.append([])
|
| 528 |
+
while (len(st.session_state.categorySelect) < len(valid_files)):
|
| 529 |
+
tempCategories = [[] for cat in st.session_state.categories]
|
| 530 |
+
st.session_state.categorySelect.append(tempCategories)
|
| 531 |
+
while (len(st.session_state.summaries) < len(valid_files)):
|
| 532 |
+
st.session_state.summaries.append([])
|
| 533 |
+
|
| 534 |
with st.spinner(text=f'Loading Demo Sample'):
|
| 535 |
# RTTM load as filler
|
| 536 |
speakerList, annotations = su.loadAudioRTTM(file_paths[0])
|