Python API Documentation (Experimental)¶
DemographicEstimator class¶
-
class
realeyes.demographic_estimation.
DemographicEstimator
(model_file, max_concurrency=0)¶ The Demographic Estimator class
-
__init__
(self, model_file, max_concurrency=0)¶ DemographicEstimator constructor: loads model file, sets up the processing.
- Parameters:
model_file (str) – path for the used model
max_concurrency (int) – maximum allowed concurrency, 0 means automatic (using all cores), default: 0
-
detect_faces
(self, image)¶ Detects the faces on an image.
- Parameters:
image (numpy.ndarray) – image of the face(s)
:rtype list[Face]
-
estimate
(self, face)¶ Returns the demographic estimation of the detected face.
- Parameters:
face (Face) – face to embed.
:rtype list[Output]
-
verify_under
(self, face, age)¶ Returns the age verification of the detected face.
- Parameters:
face (Face) – face to embed.
age (float) – age threshold.
:rtype list[Output]
-
verify_over
(self, face, age)¶ Returns the age verification of the detected face.
- Parameters:
face (Face) – face to embed.
age (float) – age threshold.
:rtype list[Output]
-
get_model_name
(self)¶ Returns the name (version etc) of the loaded model.
:rtype str
-
Result classes¶
Face¶
-
class
realeyes.demographic_estimation.
Face
¶ -
__init__
(self, image, landmarks, bbox=BoundingBox(x=0, y=0, width=0, height=0), confidence=0.0)¶ Face constructor to use a 3rd party face detector as face source
- Parameters:
image (numpy.ndarray) – image of the face
landmarks (list[Point2d]) – landmarks of the face, see landmarks specification
bbox (BoundingBox) – bounding box of the face
confidence (float) – confidence value of the detected face
-
bounding_box
: BoundingBox¶ Returns the bounding box of the detected face.
-
confidence
: float¶ Returns the confidence value of the detected face.
-
landmarks
: list[Point2d]¶ Returns the detected landmarks of the face.
See also: landmarks specification.
-