Update app.py
Browse files
app.py
CHANGED
|
@@ -247,12 +247,14 @@ def recognize_face_optimal_ui():
|
|
| 247 |
if "not found" in result.lower(): # Check if "not found" is in the result message
|
| 248 |
st.error(result)
|
| 249 |
else:
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
|
|
|
|
|
|
|
|
|
| 253 |
else:
|
| 254 |
-
name
|
| 255 |
-
st.write(f"Best match: {name} with a similarity score of {1 - float(similarity_score):.2%}.")
|
| 256 |
|
| 257 |
# Streamlit interface for deleting a person
|
| 258 |
def delete_person_ui():
|
|
|
|
| 247 |
if "not found" in result.lower(): # Check if "not found" is in the result message
|
| 248 |
st.error(result)
|
| 249 |
else:
|
| 250 |
+
result_parts = result.split(",")
|
| 251 |
+
name = result_parts[0]
|
| 252 |
+
similarity_score = float(result_parts[1])
|
| 253 |
+
if len(result_parts) == 3:
|
| 254 |
+
email = result_parts[2]
|
| 255 |
+
st.write(f"Best match: {name} with a similarity score of {1 - similarity_score:.2%}. Email: {email}")
|
| 256 |
else:
|
| 257 |
+
st.write(f"Best match: {name} with a similarity score of {1 - similarity_score:.2%}.")
|
|
|
|
| 258 |
|
| 259 |
# Streamlit interface for deleting a person
|
| 260 |
def delete_person_ui():
|