Update app.py
Browse files
app.py
CHANGED
@@ -148,10 +148,12 @@ 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 |
-
|
152 |
-
|
153 |
|
154 |
if distance < click_threshold:
|
|
|
|
|
155 |
if time.time() - prev_key_time[0] > 2:
|
156 |
prev_key_time[0] = time.time()
|
157 |
if button.text != 'BS' and button.text != 'SPACE':
|
|
|
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 |
+
cv2.rectangle(img, (x, y), (x + bw, y + bh), color, -1,, cv2.LINE_AA)
|
156 |
+
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)
|
157 |
if time.time() - prev_key_time[0] > 2:
|
158 |
prev_key_time[0] = time.time()
|
159 |
if button.text != 'BS' and button.text != 'SPACE':
|