Skip to content

Python api autogen

FaceIdentificationAutomatic

init

FaceIdentificationAutomatic.__init__(height: int, width: int)

Initializes a new people detection object.

This needs to be called only once at the start of the application.

Arguments:

  • height:: The height of the input image in pixels.
  • width:: The width of the input image in pixels.

Returns:

  • Nothing.

process_frame

FaceIdentificationAutomatic.process_frame(
    image, delta_t: float = 0.0
) -> tuple[ErrorCodeFamiliarFaceIDAutomatic, tuple[BoxPrediction, ...]]

Process a single frame from a video sequence with RGB input.

The image must have the height and width that was specified when the FaceIdentificationAutomatic object was created.

Arguments:

  • image: A tensor of shape (video_height, video_width, 3) with RGB image data. It can be a Numpy, TensorFlow, PyTorch or Jax tensor.
  • delta_t: The time in seconds it took between this and the previous video frame (1/fps). If left to the default of 0, then the system clock will be used to compute this value.

Returns:

get_face_ids

FaceIdentificationAutomatic.get_face_ids() -> List[int]

Return the face ids of all automatically enrolled faces.

Arguments:

  • None.

Returns:

  • A list of integers, each representing a face id.

get_face_id

FaceIdentificationAutomatic.get_face_id(person_box: BoxPrediction) -> int

Retrieve the face ID that belongs to a person box.

Retrieves the face ID given a person box returned by process_frame. This function has three possible return values: - FACE_ID_UNIDENTIFIED when the provided box is not of CLASS_PERSON or when a face is not yet identified, e.g. the face is not fully visible. - FACE_ID_NOT_IN_LIBRARY when the face is visible but not found in the library, e.g. when a stranger is in view. - Any non-negative integer face-ID provided when a familiar face is identified. This function should not be called directly after restoring from a previous state.

Arguments:

  • person_box: A box returned by process_frame with class_id equal to DetectionClass::CLASS_PERSON.

Returns:

  • A non-negative integer face-ID when a face is identified, FACE_ID_UNIDENTIFIED or FACE_ID_NOT_IN_LIBRARY when it is not identified successfully, or FACE_ID_UNIDENTIFIED when the provided box is not a valid person box.