mkfallah commited on
Commit
2b70dc1
·
verified ·
1 Parent(s): bd75ae2

Update composite_gestures.py

Browse files
Files changed (1) hide show
  1. composite_gestures.py +11 -26
composite_gestures.py CHANGED
@@ -1,31 +1,16 @@
1
  # composite_gestures.py
2
- # detect gestures from sequences or combinations of micro-gestures
3
 
4
- from micro_gestures import thumb_up, thumb_down, index_pointing_up, fist_closed, palm_open, ok_sign
5
 
6
  def detect_composite_gesture(sequence):
7
- """
8
- detects composite gestures from a list of micro-gesture labels
9
- example sequence: ['fist_closed', 'palm_open']
10
- """
11
- # wave: open and close hand repeatedly
12
- if sequence == ["fist_closed", "palm_open"]:
13
- return "wave"
14
-
15
- # like_and_point: thumb up + index pointing
16
- if sequence == ["index_pointing_up", "thumb_up"]:
17
- return "like_and_point"
18
-
19
- # ok_then_thumb_up: ok sign followed by thumb up
20
- if sequence == ["ok_sign", "thumb_up"]:
21
- return "ok_then_like"
22
-
23
- # fist_then_palm: fist closed then open hand
24
- if sequence == ["fist_closed", "palm_open", "fist_closed"]:
25
- return "greeting"
26
-
27
- # point_then_thumb_down: index pointing then thumb down
28
- if sequence == ["index_pointing_up", "thumb_down"]:
29
- return "disapprove"
30
-
31
  return None
 
1
  # composite_gestures.py
2
+ # routines for detecting composite gestures from sequences of micro-gestures
3
 
4
+ from micro_gestures import fist_closed, palm_open, index_pointing_up, thumb_up
5
 
6
  def detect_composite_gesture(sequence):
7
+ # detects a composite gesture from a list of micro-gesture labels
8
+ if sequence == ["palm_open"]:
9
+ return "hello" # open hand wave
10
+ if sequence == ["palm_open", "index_pointing_up", "palm_open"]:
11
+ return "goodbye"
12
+ if sequence == ["thumb_up"]:
13
+ return "yes"
14
+ if sequence == ["index_pointing_up"]:
15
+ return "no"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  return None