@@ -82,10 +82,9 @@ def check_liveness():
82
82
faceCount2 = faceDetection (image_np2 , image_np2 .shape [1 ], image_np2 .shape [0 ], faceBoxes2 , maxFaceCount )
83
83
84
84
if faceCount1 == 1 and faceCount2 == 1 :
85
- templateExtraction (image_np1 , image_np1 .shape [1 ], image_np1 .shape [0 ], faceBoxes1 )
86
- templateExtraction (image_np2 , image_np2 .shape [1 ], image_np2 .shape [0 ], faceBoxes2 )
85
+ templateExtraction (image_np1 , image_np1 .shape [1 ], image_np1 .shape [0 ], faceBoxes1 [ 0 ] )
86
+ templateExtraction (image_np2 , image_np2 .shape [1 ], image_np2 .shape [0 ], faceBoxes2 [ 0 ] )
87
87
similarity = similarityCalculation (faceBoxes1 [0 ].templates , faceBoxes2 [0 ].templates )
88
- print ("similarity" , similarity )
89
88
if similarity > verifyThreshold :
90
89
result = "Same person"
91
90
else :
@@ -168,10 +167,9 @@ def check_liveness_base64():
168
167
faceCount2 = faceDetection (image_np2 , image_np2 .shape [1 ], image_np2 .shape [0 ], faceBoxes2 , maxFaceCount )
169
168
170
169
if faceCount1 == 1 and faceCount2 == 1 :
171
- templateExtraction (image_np1 , image_np1 .shape [1 ], image_np1 .shape [0 ], faceBoxes1 )
172
- templateExtraction (image_np2 , image_np2 .shape [1 ], image_np2 .shape [0 ], faceBoxes2 )
170
+ templateExtraction (image_np1 , image_np1 .shape [1 ], image_np1 .shape [0 ], faceBoxes1 [ 0 ] )
171
+ templateExtraction (image_np2 , image_np2 .shape [1 ], image_np2 .shape [0 ], faceBoxes2 [ 0 ] )
173
172
similarity = similarityCalculation (faceBoxes1 [0 ].templates , faceBoxes2 [0 ].templates )
174
- print ("similarity" , similarity )
175
173
if similarity > verifyThreshold :
176
174
result = "Same person"
177
175
else :
0 commit comments