evelynsaltt commited on
Commit
2717354
·
verified ·
1 Parent(s): 641ce46

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +33 -8
src/streamlit_app.py CHANGED
@@ -10,6 +10,7 @@ VIDEO_FOLDER = "./src/synthda_falling_realreal/"
10
  st.set_page_config(layout="centered")
11
  st.title("AutoSynthDa Pose Interpolation Viewer")
12
 
 
13
  st.markdown("""
14
  # AutoSynthDa Interpolation Viewer
15
 
@@ -20,22 +21,46 @@ Move the slider to explore how motion changes from one input to another.
20
  View code and try the code on Colab at github.com/nvidia/synthda
21
  """)
22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  # Slider for selecting weight
24
  weight = st.slider("Interpolation Weight", 0.0, 1.0, step=0.1)
25
 
26
- # Label logic
 
 
 
 
27
  if weight == 0.0:
28
- st.success("Showing: Input Video 1 (No interpolation)")
29
  elif weight == 1.0:
30
- st.success("Showing: Input Video 2 (No interpolation)")
31
  else:
32
  w2 = round(1.0 - weight, 1)
33
- st.info(f"Generating motion by blending {weight:.1f} of Input Video 1 and {w2:.1f} of Input Video 2")
34
-
35
 
36
- # Construct filename based on weight (rounded to one decimal for file matching)
37
- filename = f"videos_generated_{weight:.1f}.mp4"
38
- video_path = os.path.join(VIDEO_FOLDER, filename)
39
 
40
  # Show video
41
  if os.path.exists(video_path):
 
10
  st.set_page_config(layout="centered")
11
  st.title("AutoSynthDa Pose Interpolation Viewer")
12
 
13
+ # Project description
14
  st.markdown("""
15
  # AutoSynthDa Interpolation Viewer
16
 
 
21
  View code and try the code on Colab at github.com/nvidia/synthda
22
  """)
23
 
24
+ # Custom CSS for styling
25
+ st.markdown("""
26
+ <style>
27
+ .centered-text {
28
+ text-align: center;
29
+ font-size: 18px;
30
+ font-weight: 500;
31
+ margin-top: 1em;
32
+ margin-bottom: 1em;
33
+ }
34
+ .slider-label {
35
+ text-align: center;
36
+ font-size: 16px;
37
+ color: gray;
38
+ margin-bottom: 10px;
39
+ }
40
+ </style>
41
+ """, unsafe_allow_html=True)
42
+
43
+ # Slider explanation
44
+ st.markdown('<p class="slider-label">Move the slider to interpolate between Input Video 1 (0.0) and Input Video 2 (1.0)</p>', unsafe_allow_html=True)
45
+
46
  # Slider for selecting weight
47
  weight = st.slider("Interpolation Weight", 0.0, 1.0, step=0.1)
48
 
49
+ # Construct filename based on weight
50
+ filename = f"videos_generated_{weight:.1f}.mp4"
51
+ video_path = os.path.join(VIDEO_FOLDER, filename)
52
+
53
+ # Interpolation description
54
  if weight == 0.0:
55
+ interp_text = "Showing: Input Video 1 (Original)"
56
  elif weight == 1.0:
57
+ interp_text = "Showing: Input Video 2 (Original)"
58
  else:
59
  w2 = round(1.0 - weight, 1)
60
+ interp_text = f"Generated video: {weight:.1f} from Input Video 1 + {w2:.1f} from Input Video 2"
 
61
 
62
+ # Display the interpolation status
63
+ st.markdown(f'<div class="centered-text">{interp_text}</div>', unsafe_allow_html=True)
 
64
 
65
  # Show video
66
  if os.path.exists(video_path):