osheina commited on
Commit
2525e3e
·
verified ·
1 Parent(s): 4a176c0

Update pages/Camera.py

Browse files
Files changed (1) hide show
  1. 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
- if webrtc_ctx.video_receiver:
61
- gesture = inference_thread.pred
62
 
63
- if gesture not in ['no', '']:
64
- if not gestures_deque:
65
- gestures_deque.append(gesture)
66
- elif gesture != gestures_deque[-1]:
67
- gestures_deque.append(gesture)
68
 
69
- text_output.markdown(f'<p style="font-size:20px"> Current gesture: {gesture}</p>',
 
 
70
  unsafe_allow_html=True)
71
- last_5_gestures.markdown(f'<p style="font-size:20px"> Last 5 gestures: {" ".join(gestures_deque)}</p>',
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")