From 649b1aabe160bf85e27c77ba9402f150e6f99a32 Mon Sep 17 00:00:00 2001 From: SiQube Date: Mon, 6 Jan 2025 10:13:50 +0100 Subject: [PATCH] WIP --- src/pymovements/dataset/dataset.py | 12 ++++++++++++ src/pymovements/datasets/sb_sat.py | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/src/pymovements/dataset/dataset.py b/src/pymovements/dataset/dataset.py index 360fe50c..67404c23 100644 --- a/src/pymovements/dataset/dataset.py +++ b/src/pymovements/dataset/dataset.py @@ -137,6 +137,9 @@ def load( if self.definition.has_files['precomputed_events']: self.load_precomputed_events() + if self.definition.has_files['precomputed_aois']: + self.load_precomputed_aois() + # Reading measures files precomuted by authors of the dataset if self.definition.has_files['precomputed_reading_measures']: self.load_precomputed_reading_measures() @@ -213,6 +216,15 @@ def load_gaze_files( ) return self + def load_precomputed_aois(self) -> None: + """Load precomputed aois.""" + self._check_fileinfo() + self.precomputed_events = dataset_files.load_precomputed_event_files( + self.definition, + self.fileinfo['precomputed_aois'], + self.paths, + ) + def load_precomputed_events(self) -> None: """Load precomputed events.""" self._check_fileinfo() diff --git a/src/pymovements/datasets/sb_sat.py b/src/pymovements/datasets/sb_sat.py index 8fb7bcae..a025da83 100644 --- a/src/pymovements/datasets/sb_sat.py +++ b/src/pymovements/datasets/sb_sat.py @@ -132,6 +132,7 @@ class SBSAT(DatasetDefinition): 'gaze': True, 'precomputed_events': True, 'precomputed_reading_measures': False, + 'precomputed_aois': True, }, ) mirrors: dict[str, tuple[str, ...]] = field( @@ -143,6 +144,9 @@ class SBSAT(DatasetDefinition): 'precomputed_events': ( 'https://raw.githubusercontent.com/ahnchive/SB-SAT/master/fixation/', ), + 'precomputed_aois': ( + 'https://raw.githubusercontent.com/ahnchive/SB-SAT/master/fixation/', + ), }, ) resources: dict[str, tuple[dict[str, str], ...]] = field(