示例#1
0
 def __init__(self):
     self.dectection = Detection()
     self.sess = tf.Session()
     start = time.time()
     with self.sess.as_default():
         facenet.load_model(facenet_model_checkpoint)
     print('Model loading finised,cost: %ds' % ((time.time() - start)))
示例#2
0
 def __init__(self, model_path):
     self.sess = tf.InteractiveSession()
     self.sess.run(tf.global_variables_initializer())
     # Load the model
     facenet.load_model(model_path)
     # Get input and output tensors
     self.images_placeholder = tf.get_default_graph().get_tensor_by_name(
         "input:0")
     self.tf_embeddings = tf.get_default_graph().get_tensor_by_name(
         "embeddings:0")
     self.phase_train_placeholder = tf.get_default_graph(
     ).get_tensor_by_name("phase_train:0")