Spaces:
Sleeping
Sleeping
Added speaker time details
Browse files
app.py
CHANGED
|
@@ -39,6 +39,18 @@ if st.button("Analyze Audio"):
|
|
| 39 |
pred_count = len(sortedSpeakerList)
|
| 40 |
lecturer_speaker_list,_ = su.twoClassExtendAnnotation(annotations)
|
| 41 |
lecturer_pred_count = 2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
|
| 43 |
# Lecturer vs. Audience
|
| 44 |
#---------------------------------------------------------------------------
|
|
@@ -79,6 +91,14 @@ if st.button("Analyze Audio"):
|
|
| 79 |
f.set_figwidth(15)
|
| 80 |
|
| 81 |
st.pyplot(f)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
|
| 83 |
# Experimental Speaker Breakdown
|
| 84 |
#------------------------------------------------------------------------------
|
|
@@ -118,4 +138,11 @@ if st.button("Analyze Audio"):
|
|
| 118 |
f.set_figwidth(15)
|
| 119 |
|
| 120 |
st.pyplot(f)
|
| 121 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
pred_count = len(sortedSpeakerList)
|
| 40 |
lecturer_speaker_list,_ = su.twoClassExtendAnnotation(annotations)
|
| 41 |
lecturer_pred_count = 2
|
| 42 |
+
totalSeconds = 9049
|
| 43 |
+
lecturer_speaker_times = []
|
| 44 |
+
for i,speaker in enumerate(lecturer_speaker_list):
|
| 45 |
+
lecturer_speaker_times.append(0)
|
| 46 |
+
for timeSection in speaker:
|
| 47 |
+
lecturer_speaker_times[i] += timeSection[1]
|
| 48 |
+
|
| 49 |
+
all_speaker_times = []
|
| 50 |
+
for i,speaker in enumerate(sortedSpeakerList):
|
| 51 |
+
all_speaker_times.append(0)
|
| 52 |
+
for timeSection in speaker:
|
| 53 |
+
all_speaker_times[i] += timeSection[1]
|
| 54 |
|
| 55 |
# Lecturer vs. Audience
|
| 56 |
#---------------------------------------------------------------------------
|
|
|
|
| 91 |
f.set_figwidth(15)
|
| 92 |
|
| 93 |
st.pyplot(f)
|
| 94 |
+
|
| 95 |
+
st.write("Total length of audio: {}h:{:02d}m:{:02d}s".format(int(totalSeconds/3600),int((totalSeconds%3600)/60),int(totalSeconds%60)))
|
| 96 |
+
st.write("Lecturer spoke: {}h:{:02d}m:{:02d}s -> {:.2f}% of time".format(int(lecturer_speaker_times[0]/3600),
|
| 97 |
+
int((lecturer_speaker_times[0]%3600)/60),int(lecturer_speaker_times[0]%60),
|
| 98 |
+
lecturer_speaker_times[0]/totalSeconds))
|
| 99 |
+
st.write("Audience spoke: {}h:{:02d}m:{:02d}s -> {:.2f}% of time".format(int(lecturer_speaker_times[1]/3600),
|
| 100 |
+
int((lecturer_speaker_times[1]%3600)/60),int(lecturer_speaker_times[1]%60),
|
| 101 |
+
lecturer_speaker_times[1]/totalSeconds))
|
| 102 |
|
| 103 |
# Experimental Speaker Breakdown
|
| 104 |
#------------------------------------------------------------------------------
|
|
|
|
| 138 |
f.set_figwidth(15)
|
| 139 |
|
| 140 |
st.pyplot(f)
|
| 141 |
+
|
| 142 |
+
st.write("Total length of audio: {}h:{:02d}m:{:02d}s".format(int(totalSeconds/3600),int((totalSeconds%3600)/60),int(totalSeconds%60)))
|
| 143 |
+
for i,speaker in all_speaker_times:
|
| 144 |
+
st.write("Speaker {} spoke: {}h:{:02d}m:{:02d}s -> {:.2f}% of time".format(i,
|
| 145 |
+
int(speaker/3600),
|
| 146 |
+
int((speaker%3600)/60),
|
| 147 |
+
int(speaker%60),
|
| 148 |
+
speaker/totalSeconds))
|