mirror of
https://github.com/serengil/deepface.git
synced 2025-06-07 03:55:21 +00:00
lint
This commit is contained in:
parent
988afa6a70
commit
3e34675aab
@ -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]
|
||||
|
@ -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]
|
||||
|
@ -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]
|
||||
|
@ -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]
|
||||
|
Loading…
x
Reference in New Issue
Block a user