Update app.py
Browse files
app.py
CHANGED
@@ -498,17 +498,17 @@ def compare_face(frame1, frame2):
|
|
498 |
faces[i] = faces[i].resize((int(resized_w), int(resized_h)))
|
499 |
except:
|
500 |
pass
|
501 |
-
|
502 |
-
matching_result = Image.open(
|
503 |
similarity_score = ""
|
504 |
if faces[0] is not None and faces[1] is not None:
|
505 |
if score is not None:
|
506 |
str_score = str("{:.4f}".format(score))
|
507 |
if result == "SAME PERSON":
|
508 |
-
matching_result = Image.open(
|
509 |
similarity_score = f"""<br/><div class="markdown-success-container"><p style="text-align: center; font-size: 20px; color: green;">Similarity score: {str_score}</p></div>"""
|
510 |
else:
|
511 |
-
matching_result = Image.open(
|
512 |
similarity_score = f"""<br/><div class="markdown-fail-container"><p style="text-align: center; font-size: 20px; color: red;">Similarity score: {str_score}</p></div>"""
|
513 |
|
514 |
return faces[0], faces[1], matching_result, similarity_score
|
|
|
498 |
faces[i] = faces[i].resize((int(resized_w), int(resized_h)))
|
499 |
except:
|
500 |
pass
|
501 |
+
|
502 |
+
matching_result = Image.open("icons/blank.png")
|
503 |
similarity_score = ""
|
504 |
if faces[0] is not None and faces[1] is not None:
|
505 |
if score is not None:
|
506 |
str_score = str("{:.4f}".format(score))
|
507 |
if result == "SAME PERSON":
|
508 |
+
matching_result = Image.open("icons/same.png")
|
509 |
similarity_score = f"""<br/><div class="markdown-success-container"><p style="text-align: center; font-size: 20px; color: green;">Similarity score: {str_score}</p></div>"""
|
510 |
else:
|
511 |
+
matching_result = Image.open("icons/different.png")
|
512 |
similarity_score = f"""<br/><div class="markdown-fail-container"><p style="text-align: center; font-size: 20px; color: red;">Similarity score: {str_score}</p></div>"""
|
513 |
|
514 |
return faces[0], faces[1], matching_result, similarity_score
|