Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
|
@@ -875,6 +875,13 @@ try:
|
|
| 875 |
with timeline:
|
| 876 |
timeline_df = speakers_dataFrame.copy()
|
| 877 |
timeline_df["Resource"] = timeline_df["Resource"].apply(lambda s: get_display_name(s, currFileIndex))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 878 |
fig_la = px.timeline(timeline_df, x_start="Start", x_end="Finish", y="Resource", color="Resource",title="Timeline of Audio with Speakers",
|
| 879 |
color_discrete_sequence=speakerColors)
|
| 880 |
fig_la.update_yaxes(autorange="reversed")
|
|
@@ -957,8 +964,8 @@ try:
|
|
| 957 |
st.plotly_chart(fig2_la, use_container_width=True, config=config)
|
| 958 |
col6_1, col6_2 = st.columns(2)
|
| 959 |
try:
|
| 960 |
-
|
| 961 |
-
|
| 962 |
except Exception:
|
| 963 |
pass
|
| 964 |
with col6_1:
|
|
|
|
| 875 |
with timeline:
|
| 876 |
timeline_df = speakers_dataFrame.copy()
|
| 877 |
timeline_df["Resource"] = timeline_df["Resource"].apply(lambda s: get_display_name(s, currFileIndex))
|
| 878 |
+
base = dt.datetime.combine(dt.date.today(), dt.time.min)
|
| 879 |
+
timeline_df["Start"] = timeline_df["Start"].apply(
|
| 880 |
+
lambda s: base + dt.timedelta(seconds=float(s.timestamp()) if isinstance(s, dt.datetime) else float(s))
|
| 881 |
+
)
|
| 882 |
+
timeline_df["Finish"] = timeline_df["Finish"].apply(
|
| 883 |
+
lambda s: base + dt.timedelta(seconds=float(s.timestamp()) if isinstance(s, dt.datetime) else float(s))
|
| 884 |
+
)
|
| 885 |
fig_la = px.timeline(timeline_df, x_start="Start", x_end="Finish", y="Resource", color="Resource",title="Timeline of Audio with Speakers",
|
| 886 |
color_discrete_sequence=speakerColors)
|
| 887 |
fig_la.update_yaxes(autorange="reversed")
|
|
|
|
| 964 |
st.plotly_chart(fig2_la, use_container_width=True, config=config)
|
| 965 |
col6_1, col6_2 = st.columns(2)
|
| 966 |
try:
|
| 967 |
+
fig2_la.write_image("ascn_bar.pdf")
|
| 968 |
+
fig2_la.write_image("ascn_bar.svg")
|
| 969 |
except Exception:
|
| 970 |
pass
|
| 971 |
with col6_1:
|