# Python API Documentation

# Module: realeyes.face_verification

# FaceVerifier class

# class FaceVerifier(model_file, max_concurrency=0)

The Face Verifier class

# __init__(self, model_file, max_concurrency=0)

FaceVerifier 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)

Returns:

  • list[Face]

# embed_face(self, face)

Returns the embedding of the detected face.

Parameters:

  • face (Face): face to embed.

Returns:

  • list[float]

# compare_faces(self, embedding1, embedding2)

Parameters:

  • embedding1 (list[float]): embedding of the 1th face
  • embedding2 (list[float]): embedding of the 2nd face

Returns:

  • Match

# get_model_name(self)

Returns the name (version etc) of the loaded model.

Returns:

  • str

# Module Functions

# get_sdk_version_string()

Returns the version string of the SDK (and not the model).

Returns:

  • str

# Result classes

# Face

# class 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(self)

Returns the bounding box of the detected face.

Returns:

  • BoundingBox
# confidence(self)

Returns the confidence value of the detected face.

Returns:

  • float
# detection_quality(self)

Returns the detection quality of the detected face.

Returns:

  • DetectionQuality
# landmarks(self)

Returns the detected landmarks of the face.

See also: landmarks specification.

Returns:

  • list[Point2d]

# Point2d

# class Point2d(x, y)

Point2d class for the landmarks

Attributes:

  • x (float): x coordinate of landmark.
  • y (float): y coordinate of landmark.

# BoundingBox

# class BoundingBox(x, y, width, height)

Bounding Box class for the faces

Attributes:

  • x (int): X coordinate of the top-left corner.
  • y (int): Y coordinate of the top-left corner.
  • width (int): Width of the bounding box in pixels.
  • height (int): Height of the bounding box in pixels.

# Match

# class Match

Face match class

Attributes:

  • similarity (float): Similarity of the faces

# DetectionQuality

# class DetectionQuality

Detection quality indicator (enum)

Attributes:

  • Good: No issues detected
  • BadQuality: Bad quality detected
  • MaybeRolled: Face maybe rolled, embeddings could be incorrect