Spaces:
Running
Running
File size: 2,308 Bytes
4ba17b3 9c02460 4ba17b3 706f673 2bb13f8 706f673 3672275 706f673 922bb51 641ce46 922bb51 706f673 3672275 4c72af5 3672275 4c72af5 3672275 2717354 3672275 922bb51 b3a0c58 922bb51 b3a0c58 922bb51 b3a0c58 641ce46 922bb51 4c72af5 922bb51 4c72af5 922bb51 4c72af5 922bb51 4c72af5 3672275 922bb51 3672275 922bb51 3672275 922bb51 3672275 922bb51 3672275 |
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 |
import streamlit as st
import os
# Set your video directory here
VIDEO_FOLDER = "./src/synthda_falling_realreal/"
st.set_page_config(layout="wide")
# Title and instructions
st.markdown("""
<h1 style='text-align: center;'>AutoSynthDa Pose Interpolation Viewer</h1>
<p style='text-align: center; font-size: 18px;'>
AutoSynthDa blends two input motion videos to generate <strong>kinematically coherent, synthetic action sequences</strong>.
</p>
<p style='text-align: center; font-size: 16px;'>
Use the slider to explore how the motion transitions from Input Video 1 (left) to Input Video 2 (right).
</p>
<p style='text-align: center;'>
<a href='https://github.com/nvidia/synthda' target='_blank'>View the code on GitHub</a>
</p>
""", unsafe_allow_html=True)
# Slider starts at 0.5 by default
weight = st.slider("Interpolation Weight", 0.0, 1.0, step=0.1, value=0.5)
# File paths
filename_interp = f"videos_generated_{weight:.1f}.mp4"
filename_input1 = "videos_generated_0.0.mp4"
filename_input2 = "videos_generated_1.0.mp4"
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)
exists_interp = os.path.exists(video_interp)
exists_1 = os.path.exists(video_input1)
exists_2 = os.path.exists(video_input2)
# Interpolation info text
if weight == 0.0:
interp_text = "Displaying Input Video 1 (no interpolation)"
elif weight == 1.0:
interp_text = "Displaying Input Video 2 (no interpolation)"
else:
w2 = round(1.0 - weight, 1)
interp_text = f"Interpolated motion: {weight:.1f} from Input Video 1 + {w2:.1f} from Input Video 2"
st.markdown(f"<p style='text-align: center; font-size: 16px;'><strong>{interp_text}</strong></p>", unsafe_allow_html=True)
# Layout with 3 video panels
col1, col2, col3 = st.columns(3)
with col1:
st.markdown("**Input Video 1**")
if exists_1:
st.video(video_input1)
else:
st.error("Video 1 not found")
with col2:
st.markdown("**Interpolated Video**")
if exists_interp:
st.video(video_interp)
else:
st.error("Interpolated video not found")
with col3:
st.markdown("**Input Video 2**")
if exists_2:
st.video(video_input2)
else:
st.error("Video 2 not found")
|