Skip to content

Commit 7580059

Browse files
committedMay 20, 2023
Update app.py
1 parent fa1467d commit 7580059

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed
 

‎app.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,9 @@ def check_liveness():
8282
faceCount2 = faceDetection(image_np2, image_np2.shape[1], image_np2.shape[0], faceBoxes2, maxFaceCount)
8383

8484
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])
8787
similarity = similarityCalculation(faceBoxes1[0].templates, faceBoxes2[0].templates)
88-
print("similarity", similarity)
8988
if similarity > verifyThreshold:
9089
result = "Same person"
9190
else:
@@ -168,10 +167,9 @@ def check_liveness_base64():
168167
faceCount2 = faceDetection(image_np2, image_np2.shape[1], image_np2.shape[0], faceBoxes2, maxFaceCount)
169168

170169
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])
173172
similarity = similarityCalculation(faceBoxes1[0].templates, faceBoxes2[0].templates)
174-
print("similarity", similarity)
175173
if similarity > verifyThreshold:
176174
result = "Same person"
177175
else:

0 commit comments

Comments
 (0)