-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgestures.py
More file actions
41 lines (31 loc) · 802 Bytes
/
gestures.py
File metadata and controls
41 lines (31 loc) · 802 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
from enum import Enum
"""
# Maps each hand gesture to an action
## Controls
Hand position on video capture: move cursor
Fist: neutral / no actions
Point (1 finger): left-click down
Peace (2 fingers): right-click down
Thumbs up: scroll up
Thumbs down: scroll down
spacebar
keyboard gestures
"""
# Allowed gestures (string values used everywhere)
class Gesture(Enum):
FIST = "fist"
POINT = "point"
PEACE = "peace"
THUMBS_UP = "thumbs_up"
THUMBS_DOWN = "thumbs_down"
FIVE = "five"
# IMPORTANT:
# The order in this list MUST MATCH the order used during training.
GESTURE_MAP = [
Gesture.FIST, # ID 0
Gesture.POINT, # ID 1
Gesture.PEACE, # ID 2
Gesture.THUMBS_UP, # ID 3
Gesture.THUMBS_DOWN, # ID 4
Gesture.FIVE, # ID 5
]