mirror of
https://github.com/serengil/deepface.git
synced 2025-07-22 18:00:02 +00:00
chagne detector interface
This commit is contained in:
parent
b38e95c407
commit
737ee793dc
@ -1,4 +1,4 @@
|
|||||||
from typing import List, Tuple, Optional
|
from typing import List, Tuple, Optional, Union
|
||||||
from abc import ABC, abstractmethod
|
from abc import ABC, abstractmethod
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
import numpy as np
|
import numpy as np
|
||||||
@ -9,15 +9,19 @@ import numpy as np
|
|||||||
# pylint: disable=unnecessary-pass, too-few-public-methods, too-many-instance-attributes
|
# pylint: disable=unnecessary-pass, too-few-public-methods, too-many-instance-attributes
|
||||||
class Detector(ABC):
|
class Detector(ABC):
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def detect_faces(self, img: np.ndarray) -> List["FacialAreaRegion"]:
|
def detect_faces(
|
||||||
|
self,
|
||||||
|
imgs: Union[np.ndarray, List[np.ndarray]]
|
||||||
|
) -> Union[List["FacialAreaRegion"], List[List["FacialAreaRegion"]]]:
|
||||||
"""
|
"""
|
||||||
Interface for detect and align face
|
Interface for detect and align faces in a batch of images
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
img (np.ndarray): pre-loaded image as numpy array
|
imgs (Union[np.ndarray, List[np.ndarray]]): pre-loaded image as numpy array or a list of those
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
results (List[FacialAreaRegion]): A list of FacialAreaRegion objects
|
results (Union[List[List[FacialAreaRegion]], List[FacialAreaRegion]]):
|
||||||
|
A list or a list of lists of FacialAreaRegion objects
|
||||||
where each object contains:
|
where each object contains:
|
||||||
|
|
||||||
- facial_area (FacialAreaRegion): The facial area region represented
|
- facial_area (FacialAreaRegion): The facial area region represented
|
||||||
|
Loading…
x
Reference in New Issue
Block a user