Skip to content

Commit

Permalink
Update app.py
Browse files Browse the repository at this point in the history
  • Loading branch information
justin200914 committed May 20, 2023
1 parent fa1467d commit 7580059
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 7580059

Please sign in to comment.