Update app.py
Browse files
app.py
CHANGED
@@ -148,11 +148,11 @@ 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), color, -1
|
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
|
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()
|
|
|
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()
|