Spaces:
Build error
Build error
Commit
·
ebb6720
1
Parent(s):
bc2a24c
Fix invalid binary data format error in comparison mode
Browse files- face_comparison.py +4 -5
face_comparison.py
CHANGED
|
@@ -161,14 +161,12 @@ def generate_comparison_report_english(comparison_results, bboxes1, bboxes2, thr
|
|
| 161 |
"""
|
| 162 |
Generate a text report of the face comparison results
|
| 163 |
"""
|
| 164 |
-
report = []
|
| 165 |
-
|
| 166 |
# Skip if no comparison results
|
| 167 |
if not comparison_results:
|
| 168 |
-
return
|
| 169 |
|
| 170 |
# Add header
|
| 171 |
-
report
|
| 172 |
|
| 173 |
# Add comparison results
|
| 174 |
for i, face_comparisons in enumerate(comparison_results):
|
|
@@ -194,7 +192,8 @@ def generate_comparison_report_english(comparison_results, bboxes1, bboxes2, thr
|
|
| 194 |
for j, comp in enumerate(face_comparisons):
|
| 195 |
report.append(f" Face {j+1}: Similarity {comp['similarity']:.2f}%")
|
| 196 |
|
| 197 |
-
|
|
|
|
| 198 |
|
| 199 |
def draw_face_matches(image1, bboxes1, image2, bboxes2, comparison_results, threshold=50.0):
|
| 200 |
"""
|
|
|
|
| 161 |
"""
|
| 162 |
Generate a text report of the face comparison results
|
| 163 |
"""
|
|
|
|
|
|
|
| 164 |
# Skip if no comparison results
|
| 165 |
if not comparison_results:
|
| 166 |
+
return "No face comparisons were performed."
|
| 167 |
|
| 168 |
# Add header
|
| 169 |
+
report = ["Face Comparison Report:"]
|
| 170 |
|
| 171 |
# Add comparison results
|
| 172 |
for i, face_comparisons in enumerate(comparison_results):
|
|
|
|
| 192 |
for j, comp in enumerate(face_comparisons):
|
| 193 |
report.append(f" Face {j+1}: Similarity {comp['similarity']:.2f}%")
|
| 194 |
|
| 195 |
+
# Join the list into a single string with line breaks
|
| 196 |
+
return "\n".join(report)
|
| 197 |
|
| 198 |
def draw_face_matches(image1, bboxes1, image2, bboxes2, comparison_results, threshold=50.0):
|
| 199 |
"""
|