Update app.py
Browse files
app.py
CHANGED
@@ -60,16 +60,16 @@ def video_frame_callback(frame: av.VideoFrame) -> av.VideoFrame:
|
|
60 |
# Process frame using MediaPipe
|
61 |
result = hands.process(cv2.cvtColor(img, cv2.COLOR_BGR2RGB))
|
62 |
|
63 |
-
#
|
64 |
-
|
65 |
-
|
66 |
-
#
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
|
74 |
# # Add special buttons for Backspace and Space
|
75 |
# buttonList.append(Button([90 + 10 * 100, 30], 'BS', size=[125, 100]))
|
|
|
60 |
# Process frame using MediaPipe
|
61 |
result = hands.process(cv2.cvtColor(img, cv2.COLOR_BGR2RGB))
|
62 |
|
63 |
+
# Create a blank canvas for drawing the keyboard
|
64 |
+
keyboard_canvas = np.zeros_like(img)
|
65 |
+
buttonList = []
|
66 |
+
# Define buttons in each row of the virtual keyboard
|
67 |
+
for key in keys[0]:
|
68 |
+
buttonList.append(Button([30 + keys[0].index(key) * 105, 30], key))
|
69 |
+
for key in keys[1]:
|
70 |
+
buttonList.append(Button([30 + keys[1].index(key) * 105, 150], key))
|
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]))
|