Pratyush101 commited on
Commit
1661849
·
verified ·
1 Parent(s): d7fdf18

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -87,8 +87,8 @@ def video_frame_callback(frame: av.VideoFrame) -> av.VideoFrame:
87
  buttonList.append(Button([x, y], key, size=[key_width, key_height]))
88
 
89
  # Add special buttons for Backspace and Space
90
- buttonList.append(Button([int(0.9 * w), int(0.03 * h)], 'BS', size=[int(0.08 * w), key_height]))
91
- buttonList.append(Button([int(0.2 * w), int(0.4 * h)], 'SPACE', size=[int(0.6 * w), key_height]))
92
 
93
  # Draw Keyboard Buttons
94
  for button in buttonList:
@@ -148,8 +148,8 @@ def video_frame_callback(frame: av.VideoFrame) -> av.VideoFrame:
148
  x, y = button.pos
149
  bw, bh = button.size
150
  if x < x8 < x + bw and y < y8 < y + bh:
151
- cv2.rectangle(img, (x, y), (x + bw, y + bh), (0, 255, 160), -1)
152
- cv2.putText(img, button.text, (x + int(0.2 * bw), y + int(0.7 * bh)), cv2.FONT_HERSHEY_PLAIN, font_scale, (255, 255, 255), font_thickness)
153
 
154
  if distance < click_threshold:
155
  if time.time() - prev_key_time[0] > 2:
 
87
  buttonList.append(Button([x, y], key, size=[key_width, key_height]))
88
 
89
  # Add special buttons for Backspace and Space
90
+ buttonList.append(Button([int(0.85 * w), int(0.03 * h)], 'BS', size=[int(0.12 * w), key_height]))
91
+ buttonList.append(Button([int(0.2 * w), int(0.4 * h)], 'SPACE', size=[int(0.55 * w), key_height]))
92
 
93
  # Draw Keyboard Buttons
94
  for button in buttonList:
 
148
  x, y = button.pos
149
  bw, bh = button.size
150
  if x < x8 < x + bw and y < y8 < y + bh:
151
+ # cv2.rectangle(img, (x, y), (x + bw, y + bh), color, -1,, cv2.LINE_AA)
152
+ # cv2.putText(img, button.text, (x + int(0.2 * bw), y + int(0.7 * bh)), cv2.FONT_HERSHEY_PLAIN, font_scale, text_color, font_thickness)
153
 
154
  if distance < click_threshold:
155
  if time.time() - prev_key_time[0] > 2: