From 02f362eb2dfd9063536669e34e8c3f43d6a5833c Mon Sep 17 00:00:00 2001 From: Jia Guo Date: Wed, 24 Jan 2018 16:55:49 +0800 Subject: [PATCH] tiny on api --- src/api/app.py | 3 ++- src/api/face_model.py | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/api/app.py b/src/api/app.py index d45350b..719af82 100644 --- a/src/api/app.py +++ b/src/api/app.py @@ -84,7 +84,7 @@ def ver(): #print(target_image.shape) if not isinstance(target_image, list): target_image = [target_image] - print('before call') + #print('before call') #ret = model.is_same_id(source_image, target_image) ret = model.sim(source_image, target_image) except Exception as ex: @@ -92,6 +92,7 @@ def ver(): return '-1' #return str(int(ret)) + print('sim', ret) return "%1.3f"%ret if __name__ == '__main__': diff --git a/src/api/face_model.py b/src/api/face_model.py index 916c447..0d6a251 100644 --- a/src/api/face_model.py +++ b/src/api/face_model.py @@ -65,7 +65,7 @@ class FaceModel: self.model.sym = all_layers['fc1_output'] def get_aligned_face(self, img, force = False): - print('before det', img.shape) + #print('before det', img.shape) bounding_boxes, points = detect_face.detect_face(img, self.det_minsize, self.pnet, self.rnet, self.onet, self.det_threshold, self.det_factor) #if bounding_boxes.shape[0]==0: # fimg = np.copy(img) @@ -75,7 +75,7 @@ class FaceModel: print('force det', img.shape) bounding_boxes, points = detect_face.detect_face(img, self.det_minsize, self.pnet, self.rnet, self.onet, [0.3, 0.3, 0.1], self.det_factor) #bounding_boxes, points = detect_face.detect_face_force(img, None, self.pnet, self.rnet, self.onet) - print('after det') + #print('after det') if bounding_boxes.shape[0]==0: return None bindex = 0 @@ -179,6 +179,7 @@ class FaceModel: return False def sim(self, source_img, target_img_list): + print('sim start') source_face = self.get_aligned_face(source_img, True) print('source face', source_face.shape) target_face_list = []