ESC50

class paddle.audio.datasets. ESC50 ( mode: _ModeLiteral = 'train', split: int = 1, feat_type: _FeatTypeLiteral = 'raw', archive: dict[str, str] | None = None, **kwargs: Any ) [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,  # type: ignore[arg-type]
...                                         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,  # type: ignore[arg-type]
...                                         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
class meta_info ( filename, fold, target, category, esc10, src_file, take )
filename : str

Alias for field number 0

fold : str

Alias for field number 1

target : str

Alias for field number 2

category : str

Alias for field number 3

esc10 : str

Alias for field number 4

src_file : str

Alias for field number 5

take : str

Alias for field number 6