asteroid.data.librimix_dataset module¶
-
class
asteroid.data.librimix_dataset.
LibriMix
(csv_dir, task='sep_clean', sample_rate=16000, n_src=2, segment=3, return_id=False)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Dataset class for LibriMix source separation tasks.
Parameters: - csv_dir (str) – The path to the metadata file.
- task (str) –
One of
'enh_single'
,'enh_both'
,'sep_clean'
or'sep_noisy'
:'enh_single'
for single speaker speech enhancement.'enh_both'
for multi speaker speech enhancement.'sep_clean'
for two-speaker clean source separation.'sep_noisy'
for two-speaker noisy source separation.
- sample_rate (int) – The sample rate of the sources and mixtures.
- n_src (int) – The number of sources in the mixture.
- segment (int, optional) – The desired sources and mixtures length in s.
- References
- [1] “LibriMix: An Open-Source Dataset for Generalizable Speech Separation”, Cosentino et al. 2020.
-
classmethod
loaders_from_mini
(batch_size=4, **kwargs)[source]¶ Downloads MiniLibriMix and returns train and validation DataLoader.
Parameters: - batch_size (int) – Batch size of the Dataloader. Only DataLoader param. To have more control on Dataloader, call mini_from_download and instantiate the DatalLoader.
- **kwargs – keyword arguments to pass the LibriMix, see __init__. The kwargs will be fed to both the training set and validation set.
Returns: train_loader, val_loader – training and validation DataLoader out of LibriMix Dataset.
- Examples
>>> from asteroid.data import LibriMix >>> train_loader, val_loader = LibriMix.loaders_from_mini( >>> task='sep_clean', batch_size=4 >>> )
-
classmethod
mini_from_download
(**kwargs)[source]¶ Downloads MiniLibriMix and returns train and validation Dataset. If you want to instantiate the Dataset by yourself, call mini_download that returns the path to the path to the metadata files.
Parameters: **kwargs – keyword arguments to pass the LibriMix, see __init__. The kwargs will be fed to both the training set and validation set Returns: train_set, val_set – training and validation instances of LibriMix (data.Dataset). - Examples
>>> from asteroid.data import LibriMix >>> train_set, val_set = LibriMix.mini_from_download(task='sep_clean')