Spaces:
Build error
Build error
File size: 2,613 Bytes
4ba17b3 9c02460 4ba17b3 b87aec8 2bb13f8 706f673 b87aec8 3672275 b87aec8 706f673 641ce46 b87aec8 922bb51 b87aec8 706f673 b87aec8 4c72af5 3672275 b87aec8 4c72af5 3672275 2717354 b87aec8 3672275 b87aec8 b3a0c58 b87aec8 b3a0c58 b87aec8 b3a0c58 641ce46 b87aec8 922bb51 b87aec8 4c72af5 b87aec8 3672275 b87aec8 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
import streamlit as st
import os
# Video folder path
VIDEO_FOLDER = "./src/synthda_falling_realreal/"
# Streamlit page setup
st.set_page_config(layout="wide")
st.title("AutoSynthDa Pose Interpolation Viewer")
st.markdown("""
### AutoSynthDa Interpolation Viewer
AutoSynthDa blends two input motion videos to **generate kinematically coherent, synthetic action videos**.
Use the slider below to explore how the system interpolates motion from one video to another.
Source: [github.com/nvidia/synthda](https://github.com/nvidia/synthda)
""")
# Slider explanation
st.markdown(
'<p style="text-align:center;"><strong>Use the slider to control the interpolation between Input Video 1 (left) and Input Video 2 (right).</strong></p>',
unsafe_allow_html=True
)
# Slider (starts at 0.5)
weight = st.slider("Interpolation Weight", 0.0, 1.0, 0.5, step=0.1)
# Filenames
filename_interp = f"videos_generated_{weight:.1f}.mp4"
filename_input1 = "videos_generated_0.0.mp4"
filename_input2 = "videos_generated_1.0.mp4"
# Full paths
video_interp = os.path.join(VIDEO_FOLDER, filename_interp)
video_input1 = os.path.join(VIDEO_FOLDER, filename_input1)
video_input2 = os.path.join(VIDEO_FOLDER, filename_input2)
# File checks
exists_interp = os.path.exists(video_interp)
exists_1 = os.path.exists(video_input1)
exists_2 = os.path.exists(video_input2)
# Interpolation status
if weight == 0.0:
st.success("Showing Input Video 1 (no interpolation)")
elif weight == 1.0:
st.success("Showing Input Video 2 (no interpolation)")
else:
w2 = round(1.0 - weight, 1)
st.info(
f"Generated motion: {weight:.1f} from Input Video 1 + {w2:.1f} from Input Video 2"
)
# Layout: 3 columns for videos
col1, col2, col3 = st.columns(3)
# Helper to show video with autoplay
def render_video_column(col, label, video_path, exists):
with col:
st.markdown(f"<div style='text-align: center; font-weight: bold;'>{label}</div>", unsafe_allow_html=True)
if exists:
st.markdown(
f"""
<video width="100%" autoplay loop muted playsinline>
<source src="{video_path}" type="video/mp4">
Your browser does not support the video tag.
</video>
""",
unsafe_allow_html=True
)
else:
st.error(f"{label} not found")
# Show videos
render_video_column(col1, "Input Video 1", video_input1, exists_1)
render_video_column(col2, "Interpolated Video", video_interp, exists_interp)
render_video_column(col3, "Input Video 2", video_input2, exists_2)
|