Spaces:
Running
Running
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +28 -34
src/streamlit_app.py
CHANGED
@@ -1,6 +1,3 @@
|
|
1 |
-
import altair as alt
|
2 |
-
import numpy as np
|
3 |
-
import pandas as pd
|
4 |
import streamlit as st
|
5 |
import os
|
6 |
|
@@ -8,26 +5,23 @@ import os
|
|
8 |
VIDEO_FOLDER = "./src/synthda_falling_realreal/"
|
9 |
|
10 |
st.set_page_config(layout="wide")
|
11 |
-
st.title("AutoSynthDa Pose Interpolation Viewer")
|
12 |
|
|
|
13 |
st.markdown("""
|
14 |
-
|
15 |
-
|
16 |
-
AutoSynthDa blends two input motion videos to
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
)
|
28 |
-
|
29 |
-
# Slider for selecting interpolation weight
|
30 |
-
weight = st.slider("Interpolation Weight", 0.0, 1.0, step=0.1)
|
31 |
|
32 |
# File paths
|
33 |
filename_interp = f"videos_generated_{weight:.1f}.mp4"
|
@@ -42,37 +36,37 @@ exists_interp = os.path.exists(video_interp)
|
|
42 |
exists_1 = os.path.exists(video_input1)
|
43 |
exists_2 = os.path.exists(video_input2)
|
44 |
|
45 |
-
#
|
46 |
if weight == 0.0:
|
47 |
-
|
48 |
elif weight == 1.0:
|
49 |
-
|
50 |
else:
|
51 |
w2 = round(1.0 - weight, 1)
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
|
56 |
-
#
|
57 |
col1, col2, col3 = st.columns(3)
|
58 |
|
59 |
with col1:
|
60 |
-
st.markdown("**Input Video 1**"
|
61 |
if exists_1:
|
62 |
-
|
63 |
else:
|
64 |
st.error("Video 1 not found")
|
65 |
|
66 |
with col2:
|
67 |
-
st.markdown("**Interpolated Video**"
|
68 |
if exists_interp:
|
69 |
-
|
70 |
else:
|
71 |
st.error("Interpolated video not found")
|
72 |
|
73 |
with col3:
|
74 |
-
st.markdown("**Input Video 2**"
|
75 |
if exists_2:
|
76 |
-
|
77 |
else:
|
78 |
st.error("Video 2 not found")
|
|
|
|
|
|
|
|
|
1 |
import streamlit as st
|
2 |
import os
|
3 |
|
|
|
5 |
VIDEO_FOLDER = "./src/synthda_falling_realreal/"
|
6 |
|
7 |
st.set_page_config(layout="wide")
|
|
|
8 |
|
9 |
+
# Title and instructions
|
10 |
st.markdown("""
|
11 |
+
<h1 style='text-align: center;'>AutoSynthDa Pose Interpolation Viewer</h1>
|
12 |
+
<p style='text-align: center; font-size: 18px;'>
|
13 |
+
AutoSynthDa blends two input motion videos to generate <strong>kinematically coherent, synthetic action sequences</strong>.
|
14 |
+
</p>
|
15 |
+
<p style='text-align: center; font-size: 16px;'>
|
16 |
+
Use the slider to explore how the motion transitions from Input Video 1 (left) to Input Video 2 (right).
|
17 |
+
</p>
|
18 |
+
<p style='text-align: center;'>
|
19 |
+
<a href='https://github.com/nvidia/synthda' target='_blank'>View the code on GitHub</a>
|
20 |
+
</p>
|
21 |
+
""", unsafe_allow_html=True)
|
22 |
+
|
23 |
+
# Slider starts at 0.5 by default
|
24 |
+
weight = st.slider("Interpolation Weight", 0.0, 1.0, step=0.1, value=0.5)
|
|
|
|
|
|
|
25 |
|
26 |
# File paths
|
27 |
filename_interp = f"videos_generated_{weight:.1f}.mp4"
|
|
|
36 |
exists_1 = os.path.exists(video_input1)
|
37 |
exists_2 = os.path.exists(video_input2)
|
38 |
|
39 |
+
# Interpolation info text
|
40 |
if weight == 0.0:
|
41 |
+
interp_text = "Displaying Input Video 1 (no interpolation)"
|
42 |
elif weight == 1.0:
|
43 |
+
interp_text = "Displaying Input Video 2 (no interpolation)"
|
44 |
else:
|
45 |
w2 = round(1.0 - weight, 1)
|
46 |
+
interp_text = f"Interpolated motion: {weight:.1f} from Input Video 1 + {w2:.1f} from Input Video 2"
|
47 |
+
|
48 |
+
st.markdown(f"<p style='text-align: center; font-size: 16px;'><strong>{interp_text}</strong></p>", unsafe_allow_html=True)
|
49 |
|
50 |
+
# Layout with 3 video panels
|
51 |
col1, col2, col3 = st.columns(3)
|
52 |
|
53 |
with col1:
|
54 |
+
st.markdown("**Input Video 1**")
|
55 |
if exists_1:
|
56 |
+
st.video(video_input1)
|
57 |
else:
|
58 |
st.error("Video 1 not found")
|
59 |
|
60 |
with col2:
|
61 |
+
st.markdown("**Interpolated Video**")
|
62 |
if exists_interp:
|
63 |
+
st.video(video_interp)
|
64 |
else:
|
65 |
st.error("Interpolated video not found")
|
66 |
|
67 |
with col3:
|
68 |
+
st.markdown("**Input Video 2**")
|
69 |
if exists_2:
|
70 |
+
st.video(video_input2)
|
71 |
else:
|
72 |
st.error("Video 2 not found")
|