Pratyush101 commited on
Commit
e30627c
·
verified ·
1 Parent(s): 5314f2e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -101,15 +101,15 @@ def video_frame_callback(frame: av.VideoFrame) -> av.VideoFrame:
101
 
102
 
103
  # Simulate key press if finger close enough
104
- if (distance / np.sqrt(bbox[2] ** 2 + bbox[3] ** 2)) * 100 < click_threshold:
105
- if time.time() - prev_key_time[0] > 2:
106
- prev_key_time[0] = time.time()
107
- if button.text != 'BS' and button.text != 'SPACE':
108
- output_text += button.text
109
- elif button.text == 'BS':
110
- output_text = output_text[:-1]
111
- else:
112
- output_text += ' '
113
 
114
  result_queue.put(detections)
115
  st.session_state["output_text"] = output_text
 
101
 
102
 
103
  # Simulate key press if finger close enough
104
+ if (distance / np.sqrt(bbox[2] ** 2 + bbox[3] ** 2)) * 100 < click_threshold:
105
+ if time.time() - prev_key_time[0] > 2:
106
+ prev_key_time[0] = time.time()
107
+ if button.text != 'BS' and button.text != 'SPACE':
108
+ output_text += button.text
109
+ elif button.text == 'BS':
110
+ output_text = output_text[:-1]
111
+ else:
112
+ output_text += ' '
113
 
114
  result_queue.put(detections)
115
  st.session_state["output_text"] = output_text