nicetoolbox.visual.media.components

Components module for defining various visual components.

Classes:

GazeIndividualComponent: Class for visualizing individual gaze data. BodyJointsComponent: Class for visualizing body joints data. HandJointsComponent: Class for visualizing hand joints data. FaceLandmarksComponent: Class for visualizing face landmarks data. GazeInteractionComponent: Class for visualizing gaze interaction data. ProximityComponent: Class for visualizing proximity data. KinematicsComponent: Class for visualizing kinematics data.

Classes

BodyJointsComponent

Class for visualizing body joint data.

Component

Abstract class for defining visual components.

EmotionIndividualComponent

Class for visualizing emotion individual data.

FaceLandmarksComponent

Class for visualizing face landmarks data.

GazeIndividualComponent

Class for visualizing individual gaze data.

GazeInteractionComponent

Class for visualizing gaze interaction data.

HandJointsComponent

Class for visualizing hand joints data.

HeadOrientationComponent

Class for visualizing head orientation data.

KinematicsComponent

Class for visualizing kinematics data.

ProximityComponent

Class for visualizing proximity data.

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

Class for visualizing body joint data.

calculate_middle_eyes(dimension: int) Tuple[ndarray, List[str]][source]

Calculate the middle of the eyes for the given dimension.

Parameters:

dimension (int) – The dimension for the middle eyes.

Returns:

The middle eyes data and the camera names.

Return type:

Tuple[np.ndarray, List[str]]

visualize(frame_idx: int) None[source]

Visualize the body joints component.

Combines the _log_data and _log_skeleton methods to visualize the body joints component in either 2D or 3D.

Parameters:

frame_idx (int) – The frame index.

class nicetoolbox.visual.media.components.Component(visualizer_config, io, logger, component_name)[source]

Abstract class for defining visual components.

visualizer_config

Configuration settings for the visualizer.

Type:

dict

component_name

The name of the component.

Type:

str

logger

The viewer object for logging the visualizations.

Type:

viewer.Viewer

algorithm_list

The list of algorithms used for the component.

Type:

list

component_prediction_folder

The path to the component prediction folder.

Type:

str

canvas_list

The list of canvases for the component.

Type:

list

algorithms_results

The list of algorithm results for the component.

Type:

list

canvas_data

The dictionary of canvas data for the component.

Type:

dict

abstract visualize()[source]

Abstract method to visualize the component.

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

Class for visualizing emotion individual data.

Initialize the EmotionIndividualComponent.

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.

visualize(frame_idx: int) None[source]

Visualize the emotion individual component.

Combines the _log_data and _log_annotation_context method to visualize the emotion individual component in camera views.

Parameters:

frame_idx (int) – The frame index.

class nicetoolbox.visual.media.components.FaceLandmarksComponent(visualizer_config, io, logger, component_name)[source]

Class for visualizing face landmarks data.

class nicetoolbox.visual.media.components.GazeIndividualComponent(visualizer_config: Dict, io, logger, component_name: str, calib: Dict, eyes_middle_3d_data: ndarray | None = None, look_at_data_tuple: bool | None = None)[source]

Class for visualizing individual gaze data.

calib

The calibration parameters.

Type:

dict

camera_names

The camera names.

Type:

List[str]

subject_names

The subject names.

Type:

List[str]

landmarks_2d

The 2D landmarks data.

Type:

np.ndarray

eyes_middle_3d_data

The 3D eyes middle data.

Type:

np.ndarray

camera_view_subjects_middle_point_dict

The camera view subjects middle point dictionary.

Type:

Dict

look_at_data

The look at data.

Type:

np.ndarray

look_at_labels

The look at labels.

Type:

List[str]

projected_gaze_data_algs

The projected gaze data for the algorithms.

Type:

List[Dict]

Initialize the GazeIndividualComponent.

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.

  • calib (Dict) – The calibration parameters.

  • eyes_middle_3d_data (np.ndarray, optional) – The 3D eyes middle data. Defaults to None.

  • look_at_data_tuple (bool, optional) – The look at data tuple. Defaults to None.

visualize(frame_idx: int) None[source]

Visualize the gaze individual component.

Combines the _log_data method to visualize the gaze individual component in either 2D or 3D.

Parameters:

frame_idx (int) – The frame index.

class nicetoolbox.visual.media.components.GazeInteractionComponent(visualizer_config, io, logger, component_name)[source]

Class for visualizing gaze interaction data.

Initialize the GazeInteractionComponent.

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.

get_lookat_data() Tuple[ndarray, List[str]][source]

Get the look at data.

Returns:

The look at data and the look at labels.

Return type:

Tuple[np.ndarray, List[str]]

visualize()[source]

Abstract method to visualize the component.

class nicetoolbox.visual.media.components.HandJointsComponent(visualizer_config, io, logger, component_name)[source]

Class for visualizing hand joints data.

Initialize the HandJointsComponent by calling the BodyJointsComponent constructor.

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

  • io – The input/output object.

  • logger – The logger object.

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

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

Class for visualizing head orientation data.

Initialize the HeadOrientationComponent.

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.

visualize(frame_idx: int) None[source]

Visualize the head orientation component.

Combines the _log_data method to visualize the head orientation component in either 2D.

Parameters:

frame_idx (int) – The frame index.

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

Class for visualizing kinematics data.

Initialize the KinematicsComponent.

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.

visualize(frame_idx: int) None[source]

Visualize the kinematics component.

Uses the _log_data method to visualize the kinematics component.

Parameters:

frame_idx (int) – The frame index.

class nicetoolbox.visual.media.components.ProximityComponent(visualizer_config: Dict, io, logger, component_name: str, eyes_middle_3d_data: Tuple[ndarray, List[str]] | None = None, eyes_middle_2d_data: Tuple[ndarray, List[str]] | None = None)[source]

Class for visualizing proximity data.

Initialize the ProximityComponent.

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.

  • eyes_middle_3d_data (Tuple[np.ndarray, List[str]], optional) – The 3D eyes middle data. Defaults to None.

  • eyes_middle_2d_data (Tuple[np.ndarray, List[str]], optional) – The 2D eyes middle data. Defaults to None.

visualize(frame_idx: int) None[source]

Visualize the proximity component.

Uses the _log_data method to visualize the proximity component in either 2D or 3D.

Parameters:

frame_idx (int) – The frame index.