Spaces:
Running
Running
Update app.py
Browse files
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=
|
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:
|