From 3e34675aab33ed4878e9129a08625404266eaa61 Mon Sep 17 00:00:00 2001 From: galthran-wq Date: Tue, 18 Feb 2025 10:31:48 +0000 Subject: [PATCH] lint --- deepface/models/face_detection/CenterFace.py | 11 ++++++++--- deepface/models/face_detection/Dlib.py | 11 ++++++++--- deepface/models/face_detection/FastMtCnn.py | 11 ++++++++--- deepface/models/face_detection/MediaPipe.py | 11 ++++++++--- 4 files changed, 32 insertions(+), 12 deletions(-) diff --git a/deepface/models/face_detection/CenterFace.py b/deepface/models/face_detection/CenterFace.py index 03faa97..66fc6cc 100644 --- a/deepface/models/face_detection/CenterFace.py +++ b/deepface/models/face_detection/CenterFace.py @@ -34,15 +34,20 @@ class CenterFaceClient(Detector): return CenterFace(weight_path=weights_path) - def detect_faces(self, img: Union[np.ndarray, List[np.ndarray]]) -> Union[List[FacialAreaRegion], List[List[FacialAreaRegion]]]: + def detect_faces( + self, + img: Union[np.ndarray, List[np.ndarray]], + ) -> Union[List[FacialAreaRegion], List[List[FacialAreaRegion]]]: """ Detect and align face with CenterFace Args: - img (Union[np.ndarray, List[np.ndarray]]): pre-loaded image as numpy array or a list of those + img (Union[np.ndarray, List[np.ndarray]]): + pre-loaded image as numpy array or a list of those Returns: - results (Union[List[FacialAreaRegion], List[List[FacialAreaRegion]]]): A list or a list of lists of FacialAreaRegion objects + results (Union[List[FacialAreaRegion], List[List[FacialAreaRegion]]]): + A list or a list of lists of FacialAreaRegion objects """ if not isinstance(img, list): img = [img] diff --git a/deepface/models/face_detection/Dlib.py b/deepface/models/face_detection/Dlib.py index 7500fff..208b044 100644 --- a/deepface/models/face_detection/Dlib.py +++ b/deepface/models/face_detection/Dlib.py @@ -47,15 +47,20 @@ class DlibClient(Detector): detector["sp"] = sp return detector - def detect_faces(self, img: Union[np.ndarray, List[np.ndarray]]) -> Union[List[FacialAreaRegion], List[List[FacialAreaRegion]]]: + def detect_faces( + self, + img: Union[np.ndarray, List[np.ndarray]], + ) -> Union[List[FacialAreaRegion], List[List[FacialAreaRegion]]]: """ Detect and align face with dlib Args: - img (Union[np.ndarray, List[np.ndarray]]): pre-loaded image as numpy array or a list of those + img (Union[np.ndarray, List[np.ndarray]]): + pre-loaded image as numpy array or a list of those Returns: - results (Union[List[FacialAreaRegion], List[List[FacialAreaRegion]]]): A list or a list of lists of FacialAreaRegion objects + results (Union[List[FacialAreaRegion], List[List[FacialAreaRegion]]]): + A list or a list of lists of FacialAreaRegion objects """ if not isinstance(img, list): img = [img] diff --git a/deepface/models/face_detection/FastMtCnn.py b/deepface/models/face_detection/FastMtCnn.py index 2228220..ea2431e 100644 --- a/deepface/models/face_detection/FastMtCnn.py +++ b/deepface/models/face_detection/FastMtCnn.py @@ -17,15 +17,20 @@ class FastMtCnnClient(Detector): def __init__(self): self.model = self.build_model() - def detect_faces(self, img: Union[np.ndarray, List[np.ndarray]]) -> Union[List[FacialAreaRegion], List[List[FacialAreaRegion]]]: + def detect_faces( + self, + img: Union[np.ndarray, List[np.ndarray]], + ) -> Union[List[FacialAreaRegion], List[List[FacialAreaRegion]]]: """ Detect and align face with mtcnn Args: - img (Union[np.ndarray, List[np.ndarray]]): pre-loaded image as numpy array or a list of those + img (Union[np.ndarray, List[np.ndarray]]): + pre-loaded image as numpy array or a list of those Returns: - results (Union[List[FacialAreaRegion], List[List[FacialAreaRegion]]]): A list or a list of lists of FacialAreaRegion objects + results (Union[List[FacialAreaRegion], List[List[FacialAreaRegion]]]): + A list or a list of lists of FacialAreaRegion objects """ if not isinstance(img, list): img = [img] diff --git a/deepface/models/face_detection/MediaPipe.py b/deepface/models/face_detection/MediaPipe.py index 9e20c8d..4716e7c 100644 --- a/deepface/models/face_detection/MediaPipe.py +++ b/deepface/models/face_detection/MediaPipe.py @@ -43,15 +43,20 @@ class MediaPipeClient(Detector): ) return face_detection - def detect_faces(self, img: Union[np.ndarray, List[np.ndarray]]) -> Union[List[FacialAreaRegion], List[List[FacialAreaRegion]]]: + def detect_faces( + self, + img: Union[np.ndarray, List[np.ndarray]], + ) -> Union[List[FacialAreaRegion], List[List[FacialAreaRegion]]]: """ Detect and align face with mediapipe Args: - img (Union[np.ndarray, List[np.ndarray]]): pre-loaded image as numpy array or a list of those + img (Union[np.ndarray, List[np.ndarray]]): + pre-loaded image as numpy array or a list of those Returns: - results (Union[List[FacialAreaRegion], List[List[FacialAreaRegion]]]): A list or a list of lists of FacialAreaRegion objects + results (Union[List[FacialAreaRegion], List[List[FacialAreaRegion]]]): + A list or a list of lists of FacialAreaRegion objects """ if not isinstance(img, list): img = [img]