evelynsaltt commited on
Commit
8134166
·
verified ·
1 Parent(s): f5f4318

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +41 -27
src/streamlit_app.py CHANGED
@@ -1,8 +1,9 @@
1
  import streamlit as st
2
  import os
3
 
4
- # Video directory
5
- VIDEO_FOLDER = "./src/synthda_falling_realreal/"
 
6
 
7
  # Set page layout
8
  st.set_page_config(layout="wide")
@@ -38,45 +39,58 @@ else:
38
 
39
  st.markdown(f'<p style="text-align: center; color: #444;"><strong>{interp_text}</strong></p>', unsafe_allow_html=True)
40
 
41
- # Filepaths
42
  filename_interp = f"videos_generated_{weight:.1f}.mp4"
43
  filename_input1 = "videos_generated_0.0.mp4"
44
  filename_input2 = "videos_generated_1.0.mp4"
45
 
46
- video_interp = os.path.join(VIDEO_FOLDER, filename_interp)
47
- video_input1 = os.path.join(VIDEO_FOLDER, filename_input1)
48
- video_input2 = os.path.join(VIDEO_FOLDER, filename_input2)
49
 
50
  exists_interp = os.path.exists(video_interp)
51
  exists_1 = os.path.exists(video_input1)
52
  exists_2 = os.path.exists(video_input2)
53
 
54
- # Layout: 3 columns for video display
55
  col1, col2, col3 = st.columns(3)
56
 
57
  with col1:
58
- st.markdown("""
59
- <div style='text-align: center; font-weight: bold;'>
60
- Input Video 1 <span style="font-weight: normal;">(Generated with generative AI)</span>
61
- </div>
62
- """, unsafe_allow_html=True)
63
-
64
- if exists_1:
65
- st.video(video_input1)
66
- else:
67
- st.error("Video 1 not found")
68
 
69
  with col2:
70
  st.markdown("<div style='text-align: center; font-weight: bold;'>Interpolated Video</div>", unsafe_allow_html=True)
71
- if exists_interp:
72
- st.video(video_interp)
73
- else:
74
- st.error("Interpolated video not found")
75
 
76
  with col3:
77
- st.markdown("""<div style='text-align: center; font-weight: bold;'>Input Video 2 <span style="font-weight: normal;">(Obtained from real-world dataset)</span>
78
- </div>""", unsafe_allow_html=True)
79
- if exists_2:
80
- st.video(video_input2)
81
- else:
82
- st.error("Video 2 is not found")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import streamlit as st
2
  import os
3
 
4
+ # Video directories
5
+ VIDEO_FOLDER_1 = "./src/synthda_falling_realreal/"
6
+ VIDEO_FOLDER_2 = "./src/synthda_demo_fall_2/"
7
 
8
  # Set page layout
9
  st.set_page_config(layout="wide")
 
39
 
40
  st.markdown(f'<p style="text-align: center; color: #444;"><strong>{interp_text}</strong></p>', unsafe_allow_html=True)
41
 
42
+ # ---------- Row 1: synthda_falling_realreal ----------
43
  filename_interp = f"videos_generated_{weight:.1f}.mp4"
44
  filename_input1 = "videos_generated_0.0.mp4"
45
  filename_input2 = "videos_generated_1.0.mp4"
46
 
47
+ video_interp = os.path.join(VIDEO_FOLDER_1, filename_interp)
48
+ video_input1 = os.path.join(VIDEO_FOLDER_1, filename_input1)
49
+ video_input2 = os.path.join(VIDEO_FOLDER_1, filename_input2)
50
 
51
  exists_interp = os.path.exists(video_interp)
52
  exists_1 = os.path.exists(video_input1)
53
  exists_2 = os.path.exists(video_input2)
54
 
55
+ st.markdown("### Demo Set 1: Falling Real-Real Interpolation")
56
  col1, col2, col3 = st.columns(3)
57
 
58
  with col1:
59
+ st.markdown("<div style='text-align: center; font-weight: bold;'>Input Video 1 (Generated)</div>", unsafe_allow_html=True)
60
+ st.video(video_input1) if exists_1 else st.error("Video 1 not found")
 
 
 
 
 
 
 
 
61
 
62
  with col2:
63
  st.markdown("<div style='text-align: center; font-weight: bold;'>Interpolated Video</div>", unsafe_allow_html=True)
64
+ st.video(video_interp) if exists_interp else st.error("Interpolated video not found")
 
 
 
65
 
66
  with col3:
67
+ st.markdown("<div style='text-align: center; font-weight: bold;'>Input Video 2 (Real)</div>", unsafe_allow_html=True)
68
+ st.video(video_input2) if exists_2 else st.error("Video 2 not found")
69
+
70
+ # ---------- Row 2: synthda_demo_fall_2 ----------
71
+ filename_interp2 = f"videos_generated_{weight:.1f}.mp4"
72
+ filename_input1_2 = "videos_generated_0.0.mp4"
73
+ filename_input2_2 = "videos_generated_1.0.mp4"
74
+
75
+ video_interp2 = os.path.join(VIDEO_FOLDER_2, filename_interp2)
76
+ video_input1_2 = os.path.join(VIDEO_FOLDER_2, filename_input1_2)
77
+ video_input2_2 = os.path.join(VIDEO_FOLDER_2, filename_input2_2)
78
+
79
+ exists_interp2 = os.path.exists(video_interp2)
80
+ exists_1_2 = os.path.exists(video_input1_2)
81
+ exists_2_2 = os.path.exists(video_input2_2)
82
+
83
+ st.markdown("### Demo Set 2: Fall Demo Interpolation")
84
+ col4, col5, col6 = st.columns(3)
85
+
86
+ with col4:
87
+ st.markdown("<div style='text-align: center; font-weight: bold;'>Input Video 1 (Generated)</div>", unsafe_allow_html=True)
88
+ st.video(video_input1_2) if exists_1_2 else st.error("Video 1 not found")
89
+
90
+ with col5:
91
+ st.markdown("<div style='text-align: center; font-weight: bold;'>Interpolated Video</div>", unsafe_allow_html=True)
92
+ st.video(video_interp2) if exists_interp2 else st.error("Interpolated video not found")
93
+
94
+ with col6:
95
+ st.markdown("<div style='text-align: center; font-weight: bold;'>Input Video 2 (Real)</div>", unsafe_allow_html=True)
96
+ st.video(video_input2_2) if exists_2_2 else st.error("Video 2 not found")