Update app.py
Browse files
app.py
CHANGED
@@ -71,15 +71,15 @@ def video_frame_callback(frame: av.VideoFrame) -> av.VideoFrame:
|
|
71 |
for key in keys[2]:
|
72 |
buttonList.append(Button([30 + keys[2].index(key) * 105, 260], key))
|
73 |
|
74 |
-
#
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
|
84 |
detections = []
|
85 |
if result.multi_hand_landmarks:
|
|
|
71 |
for key in keys[2]:
|
72 |
buttonList.append(Button([30 + keys[2].index(key) * 105, 260], key))
|
73 |
|
74 |
+
# Add special buttons for Backspace and Space
|
75 |
+
buttonList.append(Button([90 + 10 * 100, 30], 'BS', size=[125, 100]))
|
76 |
+
buttonList.append(Button([300, 370], 'SPACE', size=[500, 100]))
|
77 |
+
for button in buttonList:
|
78 |
+
x, y = button.pos
|
79 |
+
w, h = button.size
|
80 |
+
if x < x8 < x + w and y < y8 < y + h:
|
81 |
+
cv2.rectangle(img, button.pos, (x + w, y + h), (0, 255, 160), -1)
|
82 |
+
cv2.putText(img, button.text, (x + 20, y + 70), cv2.FONT_HERSHEY_PLAIN, 5, (255, 255, 255), 3)
|
83 |
|
84 |
detections = []
|
85 |
if result.multi_hand_landmarks:
|