-
Notifications
You must be signed in to change notification settings - Fork 67
/
siamese_demo_train.py
29 lines (22 loc) · 1.25 KB
/
siamese_demo_train.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
from keras_face.library.siamese import SiameseFaceNet
def main():
fnet = SiameseFaceNet()
fnet.vgg16_include_top = True
model_dir_path = './models'
image_dir_path = "./data/images"
database = dict()
database["danielle"] = [fnet.img_to_encoding(image_dir_path + "/danielle.png")]
database["younes"] = [fnet.img_to_encoding(image_dir_path + "/younes.jpg")]
database["tian"] = [fnet.img_to_encoding(image_dir_path + "/tian.jpg")]
database["andrew"] = [fnet.img_to_encoding(image_dir_path + "/andrew.jpg")]
database["kian"] = [fnet.img_to_encoding(image_dir_path + "/kian.jpg")]
database["dan"] = [fnet.img_to_encoding(image_dir_path + "/dan.jpg")]
database["sebastiano"] = [fnet.img_to_encoding(image_dir_path + "/sebastiano.jpg")]
database["bertrand"] = [fnet.img_to_encoding(image_dir_path + "/bertrand.jpg")]
database["kevin"] = [fnet.img_to_encoding(image_dir_path + "/kevin.jpg")]
database["felix"] = [fnet.img_to_encoding(image_dir_path + "/felix.jpg")]
database["benoit"] = [fnet.img_to_encoding(image_dir_path + "/benoit.jpg")]
database["arnaud"] = [fnet.img_to_encoding(image_dir_path + "/arnaud.jpg")]
fnet.fit(database=database, model_dir_path=model_dir_path)
if __name__ == '__main__':
main()