RajaThor commited on
Commit
6c891cc
·
verified ·
1 Parent(s): 1bfb585

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -6
app.py CHANGED
@@ -248,13 +248,16 @@ def recognize_face_optimal_ui():
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():
 
248
  st.error(result)
249
  else:
250
  result_parts = result.split(",")
251
+ if len(result_parts) >= 2:
252
+ name = result_parts[0]
253
+ similarity_score = float(result_parts[1])
254
+ if len(result_parts) == 3:
255
+ email = result_parts[2]
256
+ st.write(f"Best match: {name} with a similarity score of {1 - similarity_score:.2%}. Email: {email}")
257
+ else:
258
+ st.write(f"Best match: {name} with a similarity score of {1 - similarity_score:.2%}.")
259
  else:
260
+ st.error("Invalid result format.")
261
 
262
  # Streamlit interface for deleting a person
263
  def delete_person_ui():