Dataset class#
- class pyneon.Dataset(dataset_dir: str | Path, custom: bool = False)#
Holder for multiple recordings. It reads from a directory containing a multiple recordings downloaded from Pupil Cloud with the Timeseries CSV or Timeseries CSV and Scene Video option. For example, a dataset with 2 recordings would have the following folder structure:
dataset_dir/ ├── recording_dir_1/ │ ├── info.json │ ├── gaze.csv | └── ... ├── recording_dir_2/ │ ├── info.json │ ├── gaze.csv | └── ... ├── ... ├── enrichment_info.txt └── sections.csv
Individual recordings will be read into
pyneon.Recordingobjects based onsections.csv. They are accessible through therecordingsattribute.- Parameters:
- dataset_dirstr or pathlib.Path
Path to the directory containing the dataset.
- custombool, optional
Whether to expect a custom dataset structure. If
False, the dataset is expected to follow the standard Pupil Cloud dataset structure with asections.csvfile. If True, every directory indataset_diris considered a recording directory, and thesectionsattribute is constructed from theinfoof recordings found. Defaults toFalse.
- Attributes:
- dataset_dirpathlib.Path
Path to the directory containing the dataset.
- recordingslist of Recording
List of
pyneon.Recordingobjects for each recording in the dataset.- sectionspandas.DataFrame
DataFrame containing the sections of the dataset.
Methods
load_enrichment(enrichment_dir)Load enrichment information from an enrichment directory.
- load_enrichment(enrichment_dir: str | Path)#
Load enrichment information from an enrichment directory. The directory must contain an enrichment_info.txt file. Enrichment data will be parsed for each recording ID and added to Recording object in the dataset.
The method is currently being developed and is not yet implemented.
- Parameters:
- enrichment_dirstr or pathlib.Path
Path to the directory containing the enrichment information.