-
Notifications
You must be signed in to change notification settings - Fork 78
/
Copy pathquestions.py
58 lines (51 loc) · 1.62 KB
/
questions.py
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
def question_bank(index):
questions = [
"smile",
"surprise",
"blink eyes",
"angry",
"turn face right",
"turn face left"]
return questions[index]
def challenge_result(question, out_model,blinks_up):
if question == "smile":
if len(out_model["emotion"]) == 0:
challenge = "fail"
elif out_model["emotion"][0] == "happy":
challenge = "pass"
else:
challenge = "fail"
elif question == "surprise":
if len(out_model["emotion"]) == 0:
challenge = "fail"
elif out_model["emotion"][0] == "surprise":
challenge = "pass"
else:
challenge = "fail"
elif question == "angry":
if len(out_model["emotion"]) == 0:
challenge = "fail"
elif out_model["emotion"][0] == "angry":
challenge = "pass"
else:
challenge = "fail"
elif question == "turn face right":
if len(out_model["orientation"]) == 0:
challenge = "fail"
elif out_model["orientation"][0] == "right":
challenge = "pass"
else:
challenge = "fail"
elif question == "turn face left":
if len(out_model["orientation"]) == 0:
challenge = "fail"
elif out_model["orientation"][0] == "left":
challenge = "pass"
else:
challenge = "fail"
elif question == "blink eyes":
if blinks_up == 1:
challenge = "pass"
else:
challenge = "fail"
return challenge