aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/argaze/utils/demo_gaze_features_run.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/argaze/utils/demo_gaze_features_run.py b/src/argaze/utils/demo_gaze_features_run.py
index 5507b68..aa11e10 100644
--- a/src/argaze/utils/demo_gaze_features_run.py
+++ b/src/argaze/utils/demo_gaze_features_run.py
@@ -41,6 +41,7 @@ def main():
gaze_position = GazeFeatures.GazePosition()
gaze_movement_identifier = DispersionBasedGazeMovementIdentifier.GazeMovementIdentifier(args.deviation_max_threshold, args.duration_min_threshold)
visual_scan = GazeFeatures.VisualScan()
+ tpm = TransitionProbabilityMatrix.VisualScanAnalyzer()
gaze_movement_lock = threading.Lock()
# Init timestamp
@@ -82,12 +83,18 @@ def main():
look_at = name
break
- # Append fixation to visual scan
- new_step = visual_scan.append_fixation(data_ts, gaze_movement, look_at)
+ try:
- if new_step:
+ # Append fixation to visual scan
+ new_step = visual_scan.append_fixation(data_ts, gaze_movement, look_at)
- print(visual_scan)
+ if new_step and len(visual_scan) > 1:
+
+ print(tpm.analyze(visual_scan))
+
+ except GazeFeatures.VisualScanStepError as e:
+
+ print(e)
if isinstance(gaze_movement, DispersionBasedGazeMovementIdentifier.Saccade):