Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
|
@@ -209,7 +209,9 @@ for i, tab in enumerate(audio_tabs):
|
|
| 209 |
lecturer_speaker_times[j] += timeSection[1]
|
| 210 |
|
| 211 |
lecturer_dataFrame = su.speakerListToDataFrame(lecturer_speaker_list)
|
| 212 |
-
|
|
|
|
|
|
|
| 213 |
all_speaker_times = []
|
| 214 |
for j,speaker in enumerate(sortedSpeakerList):
|
| 215 |
all_speaker_times.append(0)
|
|
@@ -237,14 +239,16 @@ for i, tab in enumerate(audio_tabs):
|
|
| 237 |
],
|
| 238 |
xaxis=dict(
|
| 239 |
range=[dt.datetime.combine(dt.date.today(), dt.time.min),dt.datetime.combine(dt.date.today(), timeMax)]
|
| 240 |
-
)
|
|
|
|
|
|
|
| 241 |
)
|
| 242 |
|
| 243 |
tab.plotly_chart(fig_la, use_container_width=True)
|
| 244 |
|
| 245 |
dataTimeList = []
|
| 246 |
-
|
| 247 |
-
|
| 248 |
df2 = pd.DataFrame(dataTimeList)
|
| 249 |
fig2_la = px.bar(dataTimeList, x="x", y="y", color="y", orientation='h')
|
| 250 |
fig2_la.update_xaxes(ticksuffix="%")
|
|
@@ -295,14 +299,16 @@ for i, tab in enumerate(audio_tabs):
|
|
| 295 |
],
|
| 296 |
xaxis=dict(
|
| 297 |
range=[dt.datetime.combine(dt.date.today(), dt.time.min),dt.datetime.combine(dt.date.today(), timeMax)]
|
| 298 |
-
)
|
|
|
|
|
|
|
| 299 |
)
|
| 300 |
|
| 301 |
tab.plotly_chart(fig_spc, use_container_width=True)
|
| 302 |
|
| 303 |
dataTimeList = []
|
| 304 |
for j, totalTime in enumerate(all_speaker_times):
|
| 305 |
-
dataTimeList.append(dict(Task=j,x=totalTime/totalSeconds,y=f'Speaker {j+1}'))
|
| 306 |
df2 = pd.DataFrame(dataTimeList)
|
| 307 |
fig2_spc = px.bar(dataTimeList, x="x", y="y", color="y", orientation='h')
|
| 308 |
fig2_spc.update_xaxes(ticksuffix="%")
|
|
|
|
| 209 |
lecturer_speaker_times[j] += timeSection[1]
|
| 210 |
|
| 211 |
lecturer_dataFrame = su.speakerListToDataFrame(lecturer_speaker_list)
|
| 212 |
+
lecturer_dataFrame.loc[lecturer_dataFrame['Resource'] == "Speaker 1", 'Resource'] = "Lecturer"
|
| 213 |
+
lecturer_dataFrame.loc[lecturer_dataFrame['Resource'] == "Speaker 2", 'Resource'] = "Audience"
|
| 214 |
+
|
| 215 |
all_speaker_times = []
|
| 216 |
for j,speaker in enumerate(sortedSpeakerList):
|
| 217 |
all_speaker_times.append(0)
|
|
|
|
| 239 |
],
|
| 240 |
xaxis=dict(
|
| 241 |
range=[dt.datetime.combine(dt.date.today(), dt.time.min),dt.datetime.combine(dt.date.today(), timeMax)]
|
| 242 |
+
),
|
| 243 |
+
xaxis_title="Time",
|
| 244 |
+
yaxis_title="Speaker"
|
| 245 |
)
|
| 246 |
|
| 247 |
tab.plotly_chart(fig_la, use_container_width=True)
|
| 248 |
|
| 249 |
dataTimeList = []
|
| 250 |
+
dataTimeList.append(dict(Task=0,x=lecturer_speaker_times[0]/totalSeconds*100,y=f'Lecturer'))
|
| 251 |
+
dataTimeList.append(dict(Task=1,x=lecturer_speaker_times[1]/totalSeconds*100,y=f'Audience'))
|
| 252 |
df2 = pd.DataFrame(dataTimeList)
|
| 253 |
fig2_la = px.bar(dataTimeList, x="x", y="y", color="y", orientation='h')
|
| 254 |
fig2_la.update_xaxes(ticksuffix="%")
|
|
|
|
| 299 |
],
|
| 300 |
xaxis=dict(
|
| 301 |
range=[dt.datetime.combine(dt.date.today(), dt.time.min),dt.datetime.combine(dt.date.today(), timeMax)]
|
| 302 |
+
),
|
| 303 |
+
xaxis_title="Time",
|
| 304 |
+
yaxis_title="Speaker"
|
| 305 |
)
|
| 306 |
|
| 307 |
tab.plotly_chart(fig_spc, use_container_width=True)
|
| 308 |
|
| 309 |
dataTimeList = []
|
| 310 |
for j, totalTime in enumerate(all_speaker_times):
|
| 311 |
+
dataTimeList.append(dict(Task=j,x=totalTime/totalSeconds*100,y=f'Speaker {j+1}'))
|
| 312 |
df2 = pd.DataFrame(dataTimeList)
|
| 313 |
fig2_spc = px.bar(dataTimeList, x="x", y="y", color="y", orientation='h')
|
| 314 |
fig2_spc.update_xaxes(ticksuffix="%")
|