nicetoolbox.detectors.feature_detectors.gaze_multiview.gaze_fusion.GazeFusion

class nicetoolbox.detectors.feature_detectors.gaze_multiview.gaze_fusion.GazeFusion(io, data, sequence_context, algorithm_instance: str)[source]

Bases: BaseFeature

Computes a single 3D gaze vector from multiple camera views and/or multiple algorithms.

Given the fused 3D gaze vectors, the user can optionally select to apply a Savitzky-Golay filter for temporal smoothing. Finally, the fused 3D gaze vectors are projected back to each camera view to obtain 2D gaze points for visualization (If enabled).

Expected Input:
  • Method detectors outputting ‘3d’ array.

  • Shape: (Subjects, Cameras, Frames, 3)

  • Optional: ‘confidence_scores’ (Subjects, Cameras, Frames) for weighted fusion.

Initialize base detector with references.

Subclasses should call super().__init__() and set inference_config.

Methods

compute

Run the fusion pipeline.

compute_output_folders

Compute extra output folders for all components.

compute_result_folders

Compute result folders for all components.

compute_viz_folders

Compute visualization folders for all components.

get_input_file

Get the input file path for a specific upstream detector.

run

Execute feature detector: compute() + post_compute().

visualization

Generates visualization images with fused gaze overlays.

Attributes

algorithm_type

components

predictions_mapping

Access predictions mapping from runtime config.

requires_out_folder

data

io

sequence_context

detector_config

algorithm_instance

inference_config

visualize

compute() Dict[str, Any] | None[source]

Run the fusion pipeline.

Returns:

A list of dictionaries containing fused results.

compute_output_folders(requires_out_folder: bool) Dict[str, str]

Compute extra output folders for all components.

compute_result_folders() Dict[str, str]

Compute result folders for all components.

compute_viz_folders(visualize: bool) Dict[str, str]

Compute visualization folders for all components.

get_input_file(component: str, algorithm: str) Path

Get the input file path for a specific upstream detector.

Parameters:
  • component – Component name (e.g., ‘body_joints’)

  • algorithm – Algorithm name (e.g., ‘hrnetw48’)

Returns:

Path to the .npz result file

property predictions_mapping

Access predictions mapping from runtime config.

run() Any

Execute feature detector: compute() + post_compute().

Returns computed data for visualization.

visualization(result: Dict[str, Any]) None[source]

Generates visualization images with fused gaze overlays.