NickKolok commited on
Commit
45efd2e
1 Parent(s): 7f8d3c0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -4,7 +4,7 @@ from deepface import DeepFace
4
  def calculate_similarity(image1, image2):
5
  # Analyze the two images for facial similarity
6
  try:
7
- result = DeepFace.verify(image1, image2, enforce_detection=False)
8
  similarity_percentage = result['distance'] * 100 # Higher distance means less similarity
9
  return 100 - similarity_percentage # Convert distance to similarity percentage
10
  except Exception as e:
 
4
  def calculate_similarity(image1, image2):
5
  # Analyze the two images for facial similarity
6
  try:
7
+ result = DeepFace.verify(image1, image2, enforce_detection=True)
8
  similarity_percentage = result['distance'] * 100 # Higher distance means less similarity
9
  return 100 - similarity_percentage # Convert distance to similarity percentage
10
  except Exception as e: