From 75800590cd9f2a3b778ec176bf465d1a731278fa Mon Sep 17 00:00:00 2001 From: justin200914 Date: Sat, 20 May 2023 09:10:44 +0800 Subject: [PATCH] Update app.py --- app.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app.py b/app.py index ab81e1f..b814928 100644 --- a/app.py +++ b/app.py @@ -82,10 +82,9 @@ def check_liveness(): faceCount2 = faceDetection(image_np2, image_np2.shape[1], image_np2.shape[0], faceBoxes2, maxFaceCount) if faceCount1 == 1 and faceCount2 == 1: - templateExtraction(image_np1, image_np1.shape[1], image_np1.shape[0], faceBoxes1) - templateExtraction(image_np2, image_np2.shape[1], image_np2.shape[0], faceBoxes2) + templateExtraction(image_np1, image_np1.shape[1], image_np1.shape[0], faceBoxes1[0]) + templateExtraction(image_np2, image_np2.shape[1], image_np2.shape[0], faceBoxes2[0]) similarity = similarityCalculation(faceBoxes1[0].templates, faceBoxes2[0].templates) - print("similarity", similarity) if similarity > verifyThreshold: result = "Same person" else: @@ -168,10 +167,9 @@ def check_liveness_base64(): faceCount2 = faceDetection(image_np2, image_np2.shape[1], image_np2.shape[0], faceBoxes2, maxFaceCount) if faceCount1 == 1 and faceCount2 == 1: - templateExtraction(image_np1, image_np1.shape[1], image_np1.shape[0], faceBoxes1) - templateExtraction(image_np2, image_np2.shape[1], image_np2.shape[0], faceBoxes2) + templateExtraction(image_np1, image_np1.shape[1], image_np1.shape[0], faceBoxes1[0]) + templateExtraction(image_np2, image_np2.shape[1], image_np2.shape[0], faceBoxes2[0]) similarity = similarityCalculation(faceBoxes1[0].templates, faceBoxes2[0].templates) - print("similarity", similarity) if similarity > verifyThreshold: result = "Same person" else: