refactor: Update face location handling to DeepFace format across the codebase

This commit refactors the handling of face location data to exclusively use the DeepFace format ({x, y, w, h}) instead of the legacy tuple format (top, right, bottom, left). Key changes include updating method signatures, modifying internal logic for face quality score calculations, and ensuring compatibility in the GUI components. Additionally, configuration settings for face detection have been adjusted to allow for smaller face sizes and lower confidence thresholds, enhancing the system's ability to detect faces in various conditions. All relevant tests have been updated to reflect these changes, ensuring continued functionality and performance.
This commit is contained in:
tanyar09
2025-10-17 12:55:11 -04:00
parent 68673ccdbe
commit 2828b9966b
9 changed files with 299 additions and 206 deletions
+2 -2
View File
@@ -88,7 +88,7 @@ class PhotoTagger:
"""Process unprocessed photos for faces with optional progress and cancellation"""
return self.face_processor.process_faces(limit, model, progress_callback, stop_event)
def _extract_face_crop(self, photo_path: str, location: tuple, face_id: int) -> str:
def _extract_face_crop(self, photo_path: str, location: dict, face_id: int) -> str:
"""Extract and save individual face crop for identification (legacy compatibility)"""
return self.face_processor._extract_face_crop(photo_path, location, face_id)
@@ -96,7 +96,7 @@ class PhotoTagger:
"""Create a side-by-side comparison image (legacy compatibility)"""
return self.face_processor._create_comparison_image(unid_crop_path, match_crop_path, person_name, confidence)
def _calculate_face_quality_score(self, image, face_location: tuple) -> float:
def _calculate_face_quality_score(self, image, face_location: dict) -> float:
"""Calculate face quality score (legacy compatibility)"""
return self.face_processor._calculate_face_quality_score(image, face_location)