refactor: Update face processing methods to accept optional limits for photo processing
This commit modifies the `process_faces` method in both the `PhotoTagger` and `FaceProcessor` classes to accept an optional `limit` parameter. If `None`, all unprocessed photos will be processed, enhancing flexibility in face processing. Additionally, the `get_unprocessed_photos` method in `DatabaseManager` is updated to handle the optional limit, ensuring consistent behavior across the application. Docstrings have been updated to reflect these changes, improving code documentation and clarity.
This commit is contained in:
+6
-2
@@ -84,8 +84,12 @@ class PhotoTagger:
|
||||
return self.photo_manager.extract_photo_date(photo_path)
|
||||
|
||||
# Face processing methods (delegated)
|
||||
def process_faces(self, limit: int = DEFAULT_PROCESSING_LIMIT, model: str = DEFAULT_FACE_DETECTION_MODEL, progress_callback=None, stop_event=None) -> int:
|
||||
"""Process unprocessed photos for faces with optional progress and cancellation"""
|
||||
def process_faces(self, limit: Optional[int] = None, model: str = DEFAULT_FACE_DETECTION_MODEL, progress_callback=None, stop_event=None) -> int:
|
||||
"""Process unprocessed photos for faces with optional progress and cancellation
|
||||
|
||||
Args:
|
||||
limit: Maximum number of photos to process. If None, process all unprocessed photos.
|
||||
"""
|
||||
return self.face_processor.process_faces(limit, model, progress_callback, stop_event)
|
||||
|
||||
def _extract_face_crop(self, photo_path: str, location: dict, face_id: int) -> str:
|
||||
|
||||
Reference in New Issue
Block a user