chenemii commited on
Commit
f0557d7
·
1 Parent(s): 7a0d98b

Remove results page and go directly to options

Browse files

- Convert Step 3 from 'See Results' to 'Choose Your Options'
- Remove detailed results display and go straight to choice screen
- Update navigation from 'Results' to 'Options' in sidebar
- Add styled option cards for better UX
- Move video display to collapsible expander
- Focus on action buttons: Improvements vs Chatbot

Files changed (1) hide show
  1. app/streamlit_app.py +26 -23
app/streamlit_app.py CHANGED
@@ -731,7 +731,7 @@ def main():
731
  with sidebar_col:
732
  st.markdown("### 🧭 Quick Navigation")
733
 
734
- if st.button("📊 Results", key="nav_results", use_container_width=True):
735
  st.session_state.current_step = 3
736
  st.rerun()
737
 
@@ -875,48 +875,51 @@ def render_step_2():
875
  st.rerun()
876
 
877
  def render_step_3():
878
- """Step 3: See Results"""
879
- st.markdown('<div class="step-header"><h2>Step 3: See Your Results</h2></div>', unsafe_allow_html=True)
880
 
881
  if st.session_state.video_analyzed:
882
  data = st.session_state.analysis_data
883
  video_path = data.get('video_path', '')
884
- swing_phases = data.get('swing_phases', [])
885
- pose_data = data.get('pose_data', [])
886
- trajectory_data = data.get('trajectory_data')
887
 
888
  st.markdown(f"""
889
- ## 🏌️ Swing Analysis Results
890
 
891
- **Video:** {os.path.basename(video_path) if video_path else 'Unknown'}
892
 
893
- ### 📊 **Analysis Summary**
894
- - **Swing Phases Detected:** {len(swing_phases) if swing_phases else 0}
895
- - **Pose Data Points:** {len(pose_data) if pose_data else 0}
896
- - **Trajectory Analysis:** {'✅ Complete' if trajectory_data else '❌ Failed'}
897
-
898
- ### 🎯 **Key Findings**
899
- - Swing timing and rhythm patterns identified
900
- - Pose alignment and form analyzed
901
- - Ball trajectory and impact mechanics evaluated
902
-
903
- **Ready to dive deeper?** Choose how you'd like to explore your swing analysis:
904
  """)
905
 
906
- # Display video if available
907
  if video_path and os.path.exists(video_path):
908
- st.markdown("### 📹 Your Swing Video")
909
- display_video(video_path, width=400)
 
 
 
910
 
911
- # Action buttons
912
  col1, col2 = st.columns(2)
913
 
914
  with col1:
 
 
 
 
 
 
 
915
  if st.button("🎯 Get Improvements", key="get_improvements", use_container_width=True):
916
  st.session_state.current_step = 4
917
  st.rerun()
918
 
919
  with col2:
 
 
 
 
 
 
 
920
  if st.button("💬 Ask Questions", key="ask_questions", use_container_width=True):
921
  st.session_state.current_step = 5
922
  st.rerun()
 
731
  with sidebar_col:
732
  st.markdown("### 🧭 Quick Navigation")
733
 
734
+ if st.button("⚙️ Options", key="nav_options", use_container_width=True):
735
  st.session_state.current_step = 3
736
  st.rerun()
737
 
 
875
  st.rerun()
876
 
877
  def render_step_3():
878
+ """Step 3: Choose Your Options"""
879
+ st.markdown('<div class="step-header"><h2>Step 3: Choose Your Next Step</h2></div>', unsafe_allow_html=True)
880
 
881
  if st.session_state.video_analyzed:
882
  data = st.session_state.analysis_data
883
  video_path = data.get('video_path', '')
 
 
 
884
 
885
  st.markdown(f"""
886
+ ## Analysis Complete!
887
 
888
+ **Video processed successfully:** {os.path.basename(video_path) if video_path else 'Unknown'}
889
 
890
+ **What's Next?** Choose how you'd like to get your swing feedback:
 
 
 
 
 
 
 
 
 
 
891
  """)
892
 
893
+ # Display video if available (smaller)
894
  if video_path and os.path.exists(video_path):
895
+ with st.expander("📹 View Your Swing Video", expanded=False):
896
+ display_video(video_path, width=300)
897
+
898
+ # Main action buttons - larger and more prominent
899
+ st.markdown("### Choose Your Path:")
900
 
 
901
  col1, col2 = st.columns(2)
902
 
903
  with col1:
904
+ st.markdown("""
905
+ <div style="text-align: center; padding: 20px; border: 2px solid #4CAF50; border-radius: 15px; margin: 10px 0;">
906
+ <h3 style="color: #0B3B0B;">🎯 AI-Powered Improvements</h3>
907
+ <p>Get personalized swing analysis with specific tips for improvement</p>
908
+ </div>
909
+ """, unsafe_allow_html=True)
910
+
911
  if st.button("🎯 Get Improvements", key="get_improvements", use_container_width=True):
912
  st.session_state.current_step = 4
913
  st.rerun()
914
 
915
  with col2:
916
+ st.markdown("""
917
+ <div style="text-align: center; padding: 20px; border: 2px solid #4CAF50; border-radius: 15px; margin: 10px 0;">
918
+ <h3 style="color: #0B3B0B;">💬 Golf Expert Q&A</h3>
919
+ <p>Ask specific questions about golf swing technique from our knowledge base</p>
920
+ </div>
921
+ """, unsafe_allow_html=True)
922
+
923
  if st.button("💬 Ask Questions", key="ask_questions", use_container_width=True):
924
  st.session_state.current_step = 5
925
  st.rerun()