Update app.py
Browse files
app.py
CHANGED
@@ -17,8 +17,7 @@ logger = logging.getLogger(__name__)
|
|
17 |
# Streamlit settings
|
18 |
st.set_page_config(page_title="Virtual Keyboard", page_icon="🏋️")
|
19 |
st.title("Interactive Virtual Keyboard")
|
20 |
-
st.subheader('''Turn on the webcam and use hand gestures to interact with the virtual keyboard.
|
21 |
-
Use 'a' and 'd' from the keyboard to change the background.''')
|
22 |
|
23 |
# Initialize MediaPipe and Background Segmentor
|
24 |
mp_hands = mp.solutions.hands
|
@@ -72,8 +71,8 @@ def video_frame_callback(frame: av.VideoFrame) -> av.VideoFrame:
|
|
72 |
buttonList.append(Button([x, y], key, size=[key_width, key_height]))
|
73 |
|
74 |
# Add special buttons for Backspace and Space
|
75 |
-
buttonList.append(Button([int(0.
|
76 |
-
buttonList.append(Button([int(0.2 * w), int(0.
|
77 |
|
78 |
# Draw Keyboard Buttons
|
79 |
for button in buttonList:
|
|
|
17 |
# Streamlit settings
|
18 |
st.set_page_config(page_title="Virtual Keyboard", page_icon="🏋️")
|
19 |
st.title("Interactive Virtual Keyboard")
|
20 |
+
st.subheader('''Turn on the webcam and use hand gestures to interact with the virtual keyboard .''')
|
|
|
21 |
|
22 |
# Initialize MediaPipe and Background Segmentor
|
23 |
mp_hands = mp.solutions.hands
|
|
|
71 |
buttonList.append(Button([x, y], key, size=[key_width, key_height]))
|
72 |
|
73 |
# Add special buttons for Backspace and Space
|
74 |
+
buttonList.append(Button([int(0.85 * w), int(0.03 * h)], 'BS', size=[int(0.1 * w), key_height]))
|
75 |
+
buttonList.append(Button([int(0.2 * w), int(0.5 * h)], 'SPACE', size=[int(0.6 * w), key_height]))
|
76 |
|
77 |
# Draw Keyboard Buttons
|
78 |
for button in buttonList:
|