emonet.data_loader module#

Module for creating dataset with augmentation. Good working version.

class emonet.data_loader.TQDataset(meta_data: pathlib.Path, data_dir: pathlib.Path, transform: Optional[Callable] = None, target_transform: Optional[Callable] = None, min_duration: Optional[int] = None, emotion: Optional[str] = None)[source]#

Bases: torch.utils.data.dataset.Dataset

Base Dataset class for emonet data.

Construct a dataset.

Parameters
  • meta_data (pathlib.Path) – Path to metadata.

  • data_dir (pathlib.Path) – Path to data directory.

  • transform (Callable) – Transformer function for input data.

  • target_transform (Callable) – Transformer function for label data.

  • min_duration (int) – Minimum duration (seconds) to filter audio files.

  • emotion (str) – Emotion to retrieve labels/score for.

__init__(meta_data: pathlib.Path, data_dir: pathlib.Path, transform: Optional[Callable] = None, target_transform: Optional[Callable] = None, min_duration: Optional[int] = None, emotion: Optional[str] = None)[source]#

Construct a dataset.

Parameters
  • meta_data (pathlib.Path) – Path to metadata.

  • data_dir (pathlib.Path) – Path to data directory.

  • transform (Callable) – Transformer function for input data.

  • target_transform (Callable) – Transformer function for label data.

  • min_duration (int) – Minimum duration (seconds) to filter audio files.

  • emotion (str) – Emotion to retrieve labels/score for.

class emonet.data_loader.TQRegressionDataset(meta_data: pathlib.Path, data_dir: pathlib.Path, transform: Optional[Callable] = None, target_transform: Optional[Callable] = None, min_duration: Optional[int] = None, emotion: Optional[str] = None)[source]#

Bases: emonet.data_loader.TQDataset

Dataset class for running emonet data as regression. Outputs an average score as training input vice an emotion(s) and label(s).

Construct a dataset.

Parameters
  • meta_data (pathlib.Path) – Path to metadata.

  • data_dir (pathlib.Path) – Path to data directory.

  • transform (Callable) – Transformer function for input data.

  • target_transform (Callable) – Transformer function for label data.

  • min_duration (int) – Minimum duration (seconds) to filter audio files.

  • emotion (str) – Emotion to retrieve labels/score for.

__init__(meta_data: pathlib.Path, data_dir: pathlib.Path, transform: Optional[Callable] = None, target_transform: Optional[Callable] = None, min_duration: Optional[int] = None, emotion: Optional[str] = None)#

Construct a dataset.

Parameters
  • meta_data (pathlib.Path) – Path to metadata.

  • data_dir (pathlib.Path) – Path to data directory.

  • transform (Callable) – Transformer function for input data.

  • target_transform (Callable) – Transformer function for label data.

  • min_duration (int) – Minimum duration (seconds) to filter audio files.

  • emotion (str) – Emotion to retrieve labels/score for.

class emonet.data_loader.TQSplitDataset(meta_data: pathlib.Path, data_dir: pathlib.Path, transform: Optional[Callable] = None, target_transform: Optional[Callable] = None, min_duration: Optional[int] = None, emotion: Optional[str] = None)[source]#

Bases: emonet.data_loader.TQDataset

Idea here was to split a single audio sample into multiple n-second samples.

Construct a dataset.

Parameters
  • meta_data (pathlib.Path) – Path to metadata.

  • data_dir (pathlib.Path) – Path to data directory.

  • transform (Callable) – Transformer function for input data.

  • target_transform (Callable) – Transformer function for label data.

  • min_duration (int) – Minimum duration (seconds) to filter audio files.

  • emotion (str) – Emotion to retrieve labels/score for.

split_sample(sample, labels, length)[source]#
__init__(meta_data: pathlib.Path, data_dir: pathlib.Path, transform: Optional[Callable] = None, target_transform: Optional[Callable] = None, min_duration: Optional[int] = None, emotion: Optional[str] = None)#

Construct a dataset.

Parameters
  • meta_data (pathlib.Path) – Path to metadata.

  • data_dir (pathlib.Path) – Path to data directory.

  • transform (Callable) – Transformer function for input data.

  • target_transform (Callable) – Transformer function for label data.

  • min_duration (int) – Minimum duration (seconds) to filter audio files.

  • emotion (str) – Emotion to retrieve labels/score for.