ESC50

class paddle.audio.datasets. ESC50 ( mode: str = 'train', split: int = 1, feat_type: str = 'raw', archive=None, **kwargs ) [source]

The ESC-50 dataset is a labeled collection of 2000 environmental audio recordings suitable for benchmarking methods of environmental sound classification. The dataset consists of 5-second-long recordings organized into 50 semantical classes (with 40 examples per class)

Reference:

ESC: Dataset for Environmental Sound Classification http://dx.doi.org/10.1145/2733373.2806390

Parameters
  • mode (str, optional) – It identifies the dataset mode (train or dev). Default:train.

  • split (int, optional) – It specify the fold of dev dataset. Default:1.

  • feat_type (str, optional) – It identifies the feature type that user wants to extract of an audio file. Default:raw.

  • archive (dict, optional) – it tells where to download the audio archive. Default:None.

Returns

Dataset. An instance of ESC50 dataset.

Examples

>>> import paddle

>>> mode = 'dev'
>>> esc50_dataset = paddle.audio.datasets.ESC50(mode=mode,
...                                         feat_type='raw')
>>> for idx in range(5):
...     audio, label = esc50_dataset[idx]
...     # do something with audio, label
...     print(audio.shape, label)
...     # [audio_data_length] , label_id
[220500] 0
[220500] 14
[220500] 36
[220500] 36
[220500] 19

>>> esc50_dataset = paddle.audio.datasets.ESC50(mode=mode,
...                                         feat_type='mfcc',
...                                         n_mfcc=40)
>>> for idx in range(5):
...     audio, label = esc50_dataset[idx]
...     # do something with mfcc feature, label
...     print(audio.shape, label)
...     # [feature_dim, length] , label_id
[40, 1723] 0
[40, 1723] 14
[40, 1723] 36
[40, 1723] 36
[40, 1723] 19
meta_info

alias of paddle.audio.datasets.esc50.META_INFO