Spaces:
Sleeping
Sleeping
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 |
-
|
| 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 |
-
#
|
| 186 |
-
video_feed.
|
| 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 |
|