Talkshow_Demo / app.py
Mounika256's picture
Upload 149 files
c244e32 verified
raw
history blame
1.53 kB
import streamlit as st
import os
import subprocess
st.title("TalkSHOW Demo")
st.write(
"Upload an audio file and generate motion using the TalkSHOW model."
)
# File uploader for audio
audio_file = st.file_uploader("Upload an audio file (.wav)", type=["wav"])
# Temporary path for uploaded file
UPLOAD_DIR = "uploaded_audios"
os.makedirs(UPLOAD_DIR, exist_ok=True)
if audio_file is not None:
file_path = os.path.join(UPLOAD_DIR, audio_file.name)
with open(file_path, "wb") as f:
f.write(audio_file.getbuffer())
st.success(f"Uploaded {audio_file.name}")
# Run demo.py (adjust path/args as needed)
if st.button("Run TalkSHOW Demo"):
with st.spinner("Generating motion..."):
# Modify this command as needed to fit demo.py usage!
command = [
"python",
"scripts/demo.py",
"--audio", file_path
# add other arguments if required, e.g., model paths, output dirs, etc.
]
result = subprocess.run(command, capture_output=True, text=True)
st.text(result.stdout)
st.text(result.stderr)
st.success("Demo complete!")
# If demo.py outputs images or videos, display them here
# st.image("output.png") or st.video("output.mp4") as needed
# Add instructions or info
st.info("This is a basic demo app. You may need to adjust arguments to demo.py based on your setup and what output you want to show.")