scripts.eye_module

Author: Yadong (Adam) Liu

class EyeGesture(name: str, position_checker: Callable[[scripts.core.position.Position], bool], tracker: scripts.core.position_tracker.PositionTracker)

Bases: scripts.core.gesture.Gesture

Author: Yadong (Adam) Liu

class EyeLandmarkDetector

Bases: object

get_raw_data(raw_data: scripts.core.raw_data.RawData, image: numpy.ndarray) None

Adds the xyz coordinates of all the hand landmarks detected on the image into the RawData instance.

Parameters
  • raw_data (RawData) – RawData instance to add the landmarks to

  • image (ndarray) – Image to process with mediapipe and read the landmarks locations from

Author: Yadong (Adam) Liu

class EyePosition(raw_eye_data: Dict[str, numpy.ndarray], used_primitives: Optional[Set[str]] = None)

Bases: scripts.core.position.Position

get_primitives_names() Set[str]
Returns

Names of all primitives that are calculated by the specific modules Position class on initialization

Return type

List[str]

get_primitive(name: str) Optional[bool]

Returns the state of the given primitive in the Position if it has been calcualated. Returns None If the primitive has not been calculated, hendce if it either is not defined for current module or the land marks needed to calcualte it were not provided

Parameters

name (str) – name of the primitive (e.g. “palm_facing_camera” or “index_pinched”)

Returns

state of the primitive

Return type

Optional[bool]

get_landmark(name: str) Optional[numpy.array]

Returns the coordinates of the landmark. Returns None if the landmarks was not provided to the Position on initialization

Parameters

name (str) – name of the landmark (e.g. “index_tip” or “wrist”)

Returns

coordinates of the landmark

Return type

Optional[np.array]

Module contents

class EyeModule

Bases: scripts.core.module.Module