RajaThor commited on
Commit
1bfb585
·
verified ·
1 Parent(s): 354034d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
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
- if "email" in result:
251
- name, similarity_score, email = result.split(",")
252
- st.write(f"Best match: {name} with a similarity score of {1 - float(similarity_score):.2%}. Email: {email}")
 
 
 
253
  else:
254
- name, similarity_score = result.split(",")
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():