evelynsaltt commited on
Commit
b3a0c58
·
verified ·
1 Parent(s): b65af1e

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +11 -3
src/streamlit_app.py CHANGED
@@ -15,13 +15,21 @@ st.markdown("Use the slider to explore how pose interpolation changes as the wei
15
  # Slider for selecting weight
16
  weight = st.slider("Interpolation Weight", 0.0, 1.0, step=0.1)
17
 
 
 
 
 
 
 
 
 
 
18
  # Construct filename based on weight (rounded to one decimal for file matching)
19
  filename = f"videos_generated_{weight:.1f}.mp4"
20
  video_path = os.path.join(VIDEO_FOLDER, filename)
21
- print(video_path)
22
 
23
- # Check if the video exists
24
  if os.path.exists(video_path):
25
  st.video(video_path)
26
  else:
27
- st.error(f"No video found for weight = {weight:.1f}")
 
15
  # Slider for selecting weight
16
  weight = st.slider("Interpolation Weight", 0.0, 1.0, step=0.1)
17
 
18
+ # Label logic
19
+ if weight == 0.0:
20
+ st.info("Showing: **Input Video 1**")
21
+ elif weight == 1.0:
22
+ st.info("Showing: **Input Video 2**")
23
+ else:
24
+ other_weight = round(1.0 - weight, 1)
25
+ st.info(f"Showing: **{weight:.1f} [Input Video 1] + {other_weight:.1f} [Input Video 2]**")
26
+
27
  # Construct filename based on weight (rounded to one decimal for file matching)
28
  filename = f"videos_generated_{weight:.1f}.mp4"
29
  video_path = os.path.join(VIDEO_FOLDER, filename)
 
30
 
31
+ # Show video
32
  if os.path.exists(video_path):
33
  st.video(video_path)
34
  else:
35
+ st.error(f"No video found for weight = {weight:.1f}")