synthda-demo / src /streamlit_app.py
evelynsaltt's picture
Update src/streamlit_app.py
b3a0c58 verified
raw
history blame
1.05 kB
import altair as alt
import numpy as np
import pandas as pd
import streamlit as st
import os
# Set your video directory here
VIDEO_FOLDER = "./src/synthda_falling_realreal/"
st.set_page_config(layout="centered")
st.title("AutoSynthDa Pose Interpolation Viewer")
st.markdown("Use the slider to explore how pose interpolation changes as the weight increases.")
# Slider for selecting weight
weight = st.slider("Interpolation Weight", 0.0, 1.0, step=0.1)
# Label logic
if weight == 0.0:
st.info("Showing: **Input Video 1**")
elif weight == 1.0:
st.info("Showing: **Input Video 2**")
else:
other_weight = round(1.0 - weight, 1)
st.info(f"Showing: **{weight:.1f} [Input Video 1] + {other_weight:.1f} [Input Video 2]**")
# Construct filename based on weight (rounded to one decimal for file matching)
filename = f"videos_generated_{weight:.1f}.mp4"
video_path = os.path.join(VIDEO_FOLDER, filename)
# Show video
if os.path.exists(video_path):
st.video(video_path)
else:
st.error(f"No video found for weight = {weight:.1f}")