1mpreccable commited on
Commit
bff0260
·
verified ·
1 Parent(s): 8bb785f

Update interface_pages/yoga_position_from_stream.py

Browse files
interface_pages/yoga_position_from_stream.py CHANGED
@@ -161,8 +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
- # For webcam video input, you'll use gr.Image
165
- video_feed = gr.Image(source="webcam", streaming=True, elem_classes="fullscreen")
166
  pose_output = gr.Textbox(label="Current Pose")
167
  timer_output = gr.Textbox(label="Pose Duration")
168
 
@@ -182,9 +181,10 @@ def yoga_position_from_stream():
182
  outputs=[debug_view, normal_view, classified_video],
183
  )
184
 
185
- # Note that gr.Image will stream frame-by-frame
186
- video_feed.stream(
187
  classify_pose,
 
188
  outputs=[classified_video, pose_output, timer_output],
189
  )
190
 
 
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
  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