1mpreccable commited on
Commit
204be6a
·
verified ·
1 Parent(s): bff0260

Update interface_pages/yoga_position_from_stream.py

Browse files
interface_pages/yoga_position_from_stream.py CHANGED
@@ -113,8 +113,8 @@ def yoga_position_from_stream():
113
  if recording:
114
  recorded_frames.append(processed_frame)
115
 
116
- # Return the processed frame
117
  return (
 
118
  processed_frame,
119
  current_position,
120
  f"Duration: {int(position_timer)} seconds",
@@ -161,7 +161,7 @@ def yoga_position_from_stream():
161
  debug_toggle = gr.Checkbox(label="Debug Mode", value=False)
162
 
163
  with gr.Column(visible=True) as normal_view:
164
- video_feed = gr.Video(source="webcam", streaming=True, elem_classes="fullscreen")
165
  pose_output = gr.Textbox(label="Current Pose")
166
  timer_output = gr.Textbox(label="Pose Duration")
167
 
@@ -181,11 +181,11 @@ def yoga_position_from_stream():
181
  outputs=[debug_view, normal_view, classified_video],
182
  )
183
 
184
- # Use the video_feed to handle the video input and processing
185
- video_feed.change(
186
  classify_pose,
187
  inputs=[video_feed],
188
- outputs=[classified_video, pose_output, timer_output],
 
189
  )
190
 
191
  start_button.click(start_recording, outputs=[recording_status])
 
113
  if recording:
114
  recorded_frames.append(processed_frame)
115
 
 
116
  return (
117
+ frame,
118
  processed_frame,
119
  current_position,
120
  f"Duration: {int(position_timer)} seconds",
 
161
  debug_toggle = gr.Checkbox(label="Debug Mode", value=False)
162
 
163
  with gr.Column(visible=True) as normal_view:
164
+ video_feed = gr.Webcam(streaming=True, elem_classes="fullscreen")
165
  pose_output = gr.Textbox(label="Current Pose")
166
  timer_output = gr.Textbox(label="Pose Duration")
167
 
 
181
  outputs=[debug_view, normal_view, classified_video],
182
  )
183
 
184
+ video_feed.stream(
 
185
  classify_pose,
186
  inputs=[video_feed],
187
+ outputs=[video_feed, classified_video, pose_output, timer_output],
188
+ show_progress=False,
189
  )
190
 
191
  start_button.click(start_recording, outputs=[recording_status])