mirror of
https://github.com/serengil/deepface.git
synced 2025-06-07 12:05:22 +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)
|
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
|
Detect and align face with CenterFace
|
||||||
|
|
||||||
Args:
|
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:
|
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):
|
if not isinstance(img, list):
|
||||||
img = [img]
|
img = [img]
|
||||||
|
@ -47,15 +47,20 @@ class DlibClient(Detector):
|
|||||||
detector["sp"] = sp
|
detector["sp"] = sp
|
||||||
return detector
|
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
|
Detect and align face with dlib
|
||||||
|
|
||||||
Args:
|
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:
|
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):
|
if not isinstance(img, list):
|
||||||
img = [img]
|
img = [img]
|
||||||
|
@ -17,15 +17,20 @@ class FastMtCnnClient(Detector):
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.model = self.build_model()
|
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
|
Detect and align face with mtcnn
|
||||||
|
|
||||||
Args:
|
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:
|
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):
|
if not isinstance(img, list):
|
||||||
img = [img]
|
img = [img]
|
||||||
|
@ -43,15 +43,20 @@ class MediaPipeClient(Detector):
|
|||||||
)
|
)
|
||||||
return face_detection
|
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
|
Detect and align face with mediapipe
|
||||||
|
|
||||||
Args:
|
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:
|
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):
|
if not isinstance(img, list):
|
||||||
img = [img]
|
img = [img]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user