def main(args): with open(args.pickle,'rb') as f: feature_array = pickle.load(f, encoding='utf-8') #model_exp = '../lib/src/ckpt/20170512-110547' model_exp = args.model graph_fr = tf.Graph() sess_fr = tf.Session(graph=graph_fr) with graph_fr.as_default(): with sess_fr.as_default(): #saverf = tf.train.import_meta_graph(os.path.join(model_exp, 'model-20180408-102900.meta')) #saverf.restore(sess_fr, os.path.join(model_exp, 'model-20180408-102900.ckpt-90')) load_model(model_exp) pnet, rnet, onet = detect_face.create_mtcnn(sess_fr, None) retrieve.recognize_face(sess_fr,pnet, rnet, onet,feature_array)
def face_det(): retrieve.recognize_face(sess_fr, pnet, rnet, onet, feature_array)
def recog_face(request): #live recognition will start...all code is written in retrieve file retrieve.recognize_face(sess_fr,pnet, rnet, onet,feature_array) return redirect('/')