Update app.py
Browse files
app.py
CHANGED
|
@@ -238,7 +238,6 @@ def recognize_face_ui():
|
|
| 238 |
email = result[email_start:email_end]
|
| 239 |
st.write(f"Email: {email}")
|
| 240 |
|
| 241 |
-
# Streamlit interface for recognizing face with optimal ID
|
| 242 |
def recognize_face_optimal_ui():
|
| 243 |
st.title("Recognize Face (Optimal)")
|
| 244 |
image_path = st.file_uploader("Upload Image", help="Upload an image for optimal face recognition")
|
|
@@ -247,20 +246,7 @@ 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 |
-
if len(result_parts) >= 2:
|
| 252 |
-
name = result_parts[0]
|
| 253 |
-
try:
|
| 254 |
-
similarity_score = float(result_parts[1])
|
| 255 |
-
if len(result_parts) == 3:
|
| 256 |
-
email = result_parts[2]
|
| 257 |
-
st.write(f"Best match: {name} with a similarity score of {1 - similarity_score:.2%}. Email: {email}")
|
| 258 |
-
else:
|
| 259 |
-
st.write(f"Best match: {name} with a similarity score of {1 - similarity_score:.2%}.")
|
| 260 |
-
except ValueError:
|
| 261 |
-
st.error("Invalid similarity score format.")
|
| 262 |
-
else:
|
| 263 |
-
st.error("Invalid result format.")
|
| 264 |
|
| 265 |
# Streamlit interface for deleting a person
|
| 266 |
def delete_person_ui():
|
|
|
|
| 238 |
email = result[email_start:email_end]
|
| 239 |
st.write(f"Email: {email}")
|
| 240 |
|
|
|
|
| 241 |
def recognize_face_optimal_ui():
|
| 242 |
st.title("Recognize Face (Optimal)")
|
| 243 |
image_path = st.file_uploader("Upload Image", help="Upload an image for optimal face recognition")
|
|
|
|
| 246 |
if "not found" in result.lower(): # Check if "not found" is in the result message
|
| 247 |
st.error(result)
|
| 248 |
else:
|
| 249 |
+
st.write(result, unsafe_allow_html=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 250 |
|
| 251 |
# Streamlit interface for deleting a person
|
| 252 |
def delete_person_ui():
|