cozmo.faces

Face recognition and enrollment.

Cozmo is capable of recognizing human faces, tracking their position and rotation (“pose”) and assigning names to them via an enrollment process.

The cozmo.world.World object keeps track of faces the robot currently knows about, along with those that are currently visible to the camera.

Each face is assigned a Face object, which generates a number of observable events whenever the face is observed, has its ID updated, is renamed, etc.

Note that these face-specific events are also passed up to the cozmo.world.World object, so events for all known faces can be observed by adding handlers there.

Module Attributes

FACE_VISIBILITY_TIMEOUT

Length of time in seconds to go without receiving an observed event before assuming that Cozmo can no longer see a face.

FACIAL_EXPRESSION_UNKNOWN

Facial expression not recognized.

FACIAL_EXPRESSION_NEUTRAL

Facial expression neutral

FACIAL_EXPRESSION_HAPPY

Facial expression happy

FACIAL_EXPRESSION_SURPRISED

Facial expression surprised

FACIAL_EXPRESSION_ANGRY

Facial expression angry

FACIAL_EXPRESSION_SAD

Facial expression sad

Functions

erase_all_enrolled_faces(conn)

Erase the enrollment (name) records for all faces.

erase_enrolled_face_by_id(conn, face_id)

Erase the enrollment (name) record for the face with this ID.

update_enrolled_face_by_id(conn, face_id, ...)

Update the name enrolled for a given face.

Classes

EvtErasedEnrolledFace(**kwargs)

Triggered when a face enrollment is removed (via erase_enrolled_face_by_id)

EvtFaceAppeared(**kwargs)

Triggered whenever a face is first visually identified by a robot.

EvtFaceDisappeared(**kwargs)

Triggered whenever a face that was previously being observed is no longer visible.

EvtFaceIdChanged(**kwargs)

Triggered whenever a face has its ID updated in engine.

EvtFaceObserved(**kwargs)

Triggered whenever a face is visually identified by the robot.

EvtFaceRenamed(**kwargs)

Triggered whenever a face is renamed (via RobotRenamedEnrolledFace)

Face(conn, world, robot[, face_id])

A single face that Cozmo has detected.