Spaces:
Sleeping
Sleeping
Update pages/Camera.py
Browse files- pages/Camera.py +11 -12
pages/Camera.py
CHANGED
|
@@ -57,21 +57,20 @@ def main(config_path):
|
|
| 57 |
)
|
| 58 |
|
| 59 |
while webrtc_ctx.state.playing:
|
| 60 |
-
|
| 61 |
-
gesture = inference_thread.pred
|
| 62 |
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
|
| 69 |
-
|
|
|
|
|
|
|
| 70 |
unsafe_allow_html=True)
|
| 71 |
-
|
| 72 |
-
unsafe_allow_html=True)
|
| 73 |
-
print(gestures_deque)
|
| 74 |
|
| 75 |
if __name__ == "__main__":
|
| 76 |
asyncio.set_event_loop(asyncio.new_event_loop())
|
| 77 |
-
main("configs/config.json")
|
|
|
|
| 57 |
)
|
| 58 |
|
| 59 |
while webrtc_ctx.state.playing:
|
| 60 |
+
gesture = inference_thread.pred
|
|
|
|
| 61 |
|
| 62 |
+
if gesture not in ['no', '']:
|
| 63 |
+
if not gestures_deque:
|
| 64 |
+
gestures_deque.append(gesture)
|
| 65 |
+
elif gesture != gestures_deque[-1]:
|
| 66 |
+
gestures_deque.append(gesture)
|
| 67 |
|
| 68 |
+
text_output.markdown(f'<p style="font-size:20px"> Current gesture: {gesture}</p>',
|
| 69 |
+
unsafe_allow_html=True)
|
| 70 |
+
last_5_gestures.markdown(f'<p style="font-size:20px"> Last 5 gestures: {" ".join(gestures_deque)}</p>',
|
| 71 |
unsafe_allow_html=True)
|
| 72 |
+
print(gestures_deque)
|
|
|
|
|
|
|
| 73 |
|
| 74 |
if __name__ == "__main__":
|
| 75 |
asyncio.set_event_loop(asyncio.new_event_loop())
|
| 76 |
+
main("configs/config.json")
|