aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThéo de la Hogue2023-05-10 10:14:08 +0200
committerThéo de la Hogue2023-05-10 10:14:08 +0200
commit41f7085be40a360dd564a39b78657876a98e7d74 (patch)
treea0a53e0f5f6b2531bcd70e05646b46cd7d28c8c0
parent172b4df68a2981bee756c6a20cc79e0f72a3e44c (diff)
downloadargaze-41f7085be40a360dd564a39b78657876a98e7d74.zip
argaze-41f7085be40a360dd564a39b78657876a98e7d74.tar.gz
argaze-41f7085be40a360dd564a39b78657876a98e7d74.tar.bz2
argaze-41f7085be40a360dd564a39b78657876a98e7d74.tar.xz
Catching VisualScanStepError.
-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):