Exemplo n.º 1
0
def main():
    fnet = SiameseFaceNet()

    model_dir_path = './models'
    image_dir_path = "./data/images"
    fnet.load_model(model_dir_path)

    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")]
    database["deepak"] = [fnet.img_to_encoding(image_dir_path + "/deepak.jpg")]
    database["momo"] = [fnet.img_to_encoding(image_dir_path + "/momo.jpg")]

    fnet.verify(image_dir_path + "/camera_0.jpg", "younes", database)
    fnet.verify(image_dir_path + "/camera_2.jpg", "kian", database)
    # fnet.verify(image_dir_path + "/test_deepak_1.jpg", "deepak", database)
    # fnet.verify(image_dir_path + "/test_momo_1.jpg", "momo", database)
    # fnet.verify(image_dir_path + "/test_momo.jpg", "deepak", database)
    fnet.who_is_it(image_dir_path + "/camera_0.jpg", database)
    fnet.who_is_it(image_dir_path + "/younes.jpg", database)
Exemplo n.º 2
0
 def predict(self, database):
     fnet = SiameseFaceNet()
     model_dir_path = './models_1'
     image_dir_path = "./data/images"
     fnet.load_model(model_dir_path)
     print("-------------------------")
     # fnet.verify(image_dir_path + "/001.png", "aipengfei", database)
     # fnet.verify(image_dir_path + "/002.png", "aipengfei", database)
     # fnet.who_is_it(image_dir_path + "/001.png", database)
     #fnet.who_is_it(image_dir_path + "/002.png", database)
     fnet.who_is_it("data/5test.jpg", database)
Exemplo n.º 3
0
 def predict(self):
     fnet = SiameseFaceNet()
     model_dir_path = './models_1'
     image_dir_path = "./data/images"
     fnet.load_model(model_dir_path)
     database = dict()
     database["aipengfei"] = [fnet.img_to_encoding(image_dir_path + "/aipengfei.png")]
     database["anyaru"] = [fnet.img_to_encoding(image_dir_path + "/anyaru.png")]
     database["baozhiqian"] = [fnet.img_to_encoding(image_dir_path + "/baozhiqian.png")]
     print("-------------------------")
     fnet.verify(image_dir_path + "/001.png", "aipengfei", database)
     fnet.verify(image_dir_path + "/002.png", "aipengfei", database)
     fnet.who_is_it(image_dir_path + "/001.png", database)
     fnet.who_is_it(image_dir_path + "/002.png", database)
     fnet.who_is_it(image_dir_path + "/003.png", database)
Exemplo n.º 4
0
 def predict(self,database):
     fnet = SiameseFaceNet()
     model_dir_path = './models_2'
     fnet.load_model(model_dir_path)
     print("-------------------------")
     # fnet.verify(image_dir_path + "/001.png", "aipengfei", database)
     # fnet.verify(image_dir_path + "/002.png", "aipengfei", database)
     # fnet.who_is_it(image_dir_path + "/001.png", database)
     #fnet.who_is_it(image_dir_path + "/002.png", database)
     fnet.who_is_it("data/test/chencongcong.png", database)
     fnet.who_is_it("data/test/chendandan.png", database)
     # fnet.who_is_it("data/test/chendaocheng.png", database)
     # fnet.who_is_it("data/test/chenfuyuan.png", database)
     # fnet.who_is_it("data/test/chenge.png", database)
     # fnet.who_is_it("data/test/chenguang.png", database)
     # fnet.who_is_it("data/test/chenguangwei.png", database)
     # fnet.who_is_it("data/test/chenguoyan.png", database)
     # fnet.who_is_it("data/test/chenhaiyan.png", database)
     # fnet.who_is_it("data/test/chenhao.png", database)