nicetoolbox.visual.media.components.EyeClosedStateComponent

class nicetoolbox.visual.media.components.EyeClosedStateComponent(visualizer_config: Dict, io, logger, component_name: str)[source]

Bases: Component

Class for reading eye closed/open state.

Carries no overlay of its own — like GazeInteractionComponent, it exists to hand its per-eye binary state to EyeClosureComponent, which recolors the eye contours with it.

camera_names

The camera names.

Type:

List[str]

subject_names

The subject names.

Type:

List[str]

Initialize the EyeClosedStateComponent.

Parameters:
  • visualizer_config (Dict) – The visualizer configuration settings.

  • io – The input/output object.

  • logger (viewer.Viewer) – The viewer rerun object.

  • component_name (str) – The name of the component.

Methods

get_closed_state_data

Get the closed-state data for every configured eye_closure_threshold instance, in list order.

visualize

Abstract method to visualize the component.

Attributes

STATE_KEY

get_closed_state_data() → List[Tuple[ndarray, List[str]]][source]

Get the closed-state data for every configured eye_closure_threshold instance, in list order.

Each entry corresponds positionally to [media.eye_closed_state].algorithms[i] and is intended to be paired with [media.eye_closure_score].algorithms[i] for coloring.

Returns:

List of (data, eye_labels) tuples, one per algorithm. Data is (subjects, cameras, frames, eyes) with 1 = closed, 0 = open, NaN = missing.

visualize(frame_idx: int) → None[source]

Abstract method to visualize the component.