-
Notifications
You must be signed in to change notification settings - Fork 1
/
face_encodings_to_file.py
108 lines (80 loc) · 4.28 KB
/
face_encodings_to_file.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
import face_recognition
import pickle
ky_imgae = face_recognition.load_image_file("sample/Ky.jpg")
ky_face_encoding = face_recognition.face_encodings(ky_imgae)[0]
ky_up_imgae = face_recognition.load_image_file("sample/Ky_Up.jpg")
ky_up_face_encoding = face_recognition.face_encodings(ky_up_imgae)[0]
ky_down_imgae = face_recognition.load_image_file("sample/Ky_Down.jpg")
ky_down_face_encoding = face_recognition.face_encodings(ky_down_imgae)[0]
ky_left_imgae = face_recognition.load_image_file("sample/Ky_Left.jpg")
ky_left_face_encoding = face_recognition.face_encodings(ky_left_imgae)[0]
ky_right_imgae = face_recognition.load_image_file("sample/Ky_Right.jpg")
ky_right_face_encoding = face_recognition.face_encodings(ky_right_imgae)[0]
nv_imgae = face_recognition.load_image_file("sample/NV.jpg")
nv_face_encoding = face_recognition.face_encodings(nv_imgae)[0]
nv_up_imgae = face_recognition.load_image_file("sample/NV_Up.jpg")
nv_up_face_encoding = face_recognition.face_encodings(nv_up_imgae)[0]
nv_down_imgae = face_recognition.load_image_file("sample/NV_Down.jpg")
nv_down_face_encoding = face_recognition.face_encodings(nv_down_imgae)[0]
nv_left_imgae = face_recognition.load_image_file("sample/NV_Left.jpg")
nv_left_face_encoding = face_recognition.face_encodings(nv_left_imgae)[0]
nv_right_imgae = face_recognition.load_image_file("sample/NV_Right.jpg")
nv_right_face_encoding = face_recognition.face_encodings(nv_right_imgae)[0]
dv_imgae = face_recognition.load_image_file("sample/DV.jpg")
dv_face_encoding = face_recognition.face_encodings(dv_imgae)[0]
dv_up_imgae = face_recognition.load_image_file("sample/DV_Up.jpg")
dv_up_face_encoding = face_recognition.face_encodings(dv_up_imgae)[0]
dv_down_imgae = face_recognition.load_image_file("sample/DV_Down.jpg")
dv_down_face_encoding = face_recognition.face_encodings(dv_down_imgae)[0]
dv_left_imgae = face_recognition.load_image_file("sample/DV_Left.jpg")
dv_left_face_encoding = face_recognition.face_encodings(dv_left_imgae)[0]
dv_right_imgae = face_recognition.load_image_file("sample/DV_Right.jpg")
dv_right_face_encoding = face_recognition.face_encodings(dv_right_imgae)[0]
bao_imgae = face_recognition.load_image_file("sample/Bao.jpg")
bao_face_encoding = face_recognition.face_encodings(bao_imgae)[0]
bao_up_imgae = face_recognition.load_image_file("sample/Bao_Up.jpg")
bao_up_face_encoding = face_recognition.face_encodings(bao_up_imgae)[0]
bao_down_imgae = face_recognition.load_image_file("sample/Bao_Down.jpg")
bao_down_face_encoding = face_recognition.face_encodings(bao_down_imgae)[0]
bao_left_imgae = face_recognition.load_image_file("sample/Bao_Left.jpg")
bao_left_face_encoding = face_recognition.face_encodings(bao_left_imgae)[0]
bao_right_imgae = face_recognition.load_image_file("sample/Bao_Right.jpg")
bao_right_face_encoding = face_recognition.face_encodings(bao_right_imgae)[0]
thai_imgae = face_recognition.load_image_file("sample/Thai.jpg")
thai_face_encoding = face_recognition.face_encodings(thai_imgae)[0]
thai_up_imgae = face_recognition.load_image_file("sample/Thai_Up.jpg")
thai_up_face_encoding = face_recognition.face_encodings(thai_up_imgae)[0]
thai_down_imgae = face_recognition.load_image_file("sample/Thai_Down.jpg")
thai_down_face_encoding = face_recognition.face_encodings(thai_down_imgae)[0]
thai_left_imgae = face_recognition.load_image_file("sample/Thai_Left.jpg")
thai_left_face_encoding = face_recognition.face_encodings(thai_left_imgae)[0]
thai_right_imgae = face_recognition.load_image_file("sample/Thai_Right.jpg")
thai_right_face_encoding = face_recognition.face_encodings(thai_right_imgae)[0]
known_face_encodings = [
nv_face_encoding,
nv_up_face_encoding,
nv_down_face_encoding,
nv_left_face_encoding,
nv_right_face_encoding,
dv_face_encoding,
dv_up_face_encoding,
dv_down_face_encoding,
dv_left_face_encoding,
dv_right_face_encoding,
bao_face_encoding,
bao_up_face_encoding,
bao_down_face_encoding,
bao_left_face_encoding,
bao_right_face_encoding,
ky_face_encoding,
ky_up_face_encoding,
ky_down_face_encoding,
ky_left_face_encoding,
ky_right_face_encoding,
thai_face_encoding,
thai_up_face_encoding,
thai_down_face_encoding,
thai_left_face_encoding,
thai_right_face_encoding
]
pickle.dump(known_face_encodings, open('face_encodings.txt', 'wb'))