audioset-16khz-wds / README.md
yangwang825's picture
Update README.md
d8e7521 verified
|
raw
history blame
3.82 kB
metadata
configs:
  - config_name: 2m
    data_files:
      - split: train
        path: 2m/train/*.tar
  - config_name: 20k
    data_files:
      - split: train
        path: 20k/train/*.tar
      - split: test
        path: 20k/test/*.tar
language:
  - en
task_categories:
  - audio-classification
tags:
  - audio
size_categories:
  - 1M<n<10M

AudioSet

AudioSet[1] is a large-scale dataset comprising approximately 2 million 10-second YouTube audio clips, categorised into 527 sound classes. We have pre-processed all audio files to a 16 kHz sampling rate and stored them in the WebDataset format for efficient large-scale training and retrieval.

Download

We recommend using the following commands to download the confit/audioset-16khz-wds dataset from HuggingFace. The dataset is available in two versions:

  • 20k (balanced): A smaller version with 20,550 clips for quick experimentation.
  • 500k[2]: A (slightly more) balanced version with 497,982 clips for quick experimentation.
  • 2m (unbalanced): The complete dataset with ~2 million clips.
  • test (eval): The test set with 18,886 clips.

NOTE: Both the 20k (balanced) and 2m (unbalanced) versions share the same test set (eval).

# For the 20k version
huggingface-cli download confit/audioset-16khz-wds --include 20k/train/*.tar  --repo-type=dataset --local-dir /path/to/store
huggingface-cli download confit/audioset-16khz-wds --include 20k/test/*.tar  --repo-type=dataset --local-dir /path/to/store

# For the 2m version
huggingface-cli download confit/audioset-16khz-wds --include 2m/train/*.tar  --repo-type=dataset --local-dir /path/to/store
huggingface-cli download confit/audioset-16khz-wds --include 2m/test/*.tar  --repo-type=dataset --local-dir /path/to/store

NOTE: The --local-dir /path/to/store argument specifies the root directory where the dataset will be stored. You do not need to manually create subdirectories (e.g., /path/to/store/20k/train). The command will automatically create the required folder structure.

Format and Usage

The dataset is stored in the WebDataset (WDS) format, which is optimised for distributed training and streaming. Each .tar archive contains audio files and corresponding metadata.

To load the dataset in Python using webdataset:

train_base_url = '/path/to/20k/train/shard-{i:05d}.tar'
train_urls = [train_base_url.format(i=i) for i in range(7)]

test_base_url = '/path/to/20k/test/shard-{i:05d}.tar'
test_urls = [test_base_url.format(i=i) for i in range(6)]

raw_datasets = load_dataset(
    "webdataset",
    data_files={"train": train_urls, "test": test_urls},
    streaming=False
)

Each sample in the dataset follows the WebDataset format, which includes the following fields:

{
    '__key__': 'sample-000000000',
    '__url__': '/path/to/20k/train/shard-00000.tar',
    'wav': {
        'path': 'sample-000000000.wav',
        'array': array([ 0., ..., -0.00256348]),
        'sampling_rate': 16000
    },
    'json': {
        'id': 'YUJxAKoY0gRM',
        'label': ['Clarinet'],
        'label_id': [198]
    }
}

References

[1] Gemmeke, J. F., Ellis, D. P., Freedman, D., Jansen, A., Lawrence, W., Moore, R. C., ... & Ritter, M. (2017, March). Audio set: An ontology and human-labeled dataset for audio events. In 2017 IEEE international conference on acoustics, speech and signal processing (ICASSP) (pp. 776-780). IEEE.

[2] Nagrani, A., Yang, S., Arnab, A., Jansen, A., Schmid, C., & Sun, C. (2021). Attention bottlenecks for multimodal fusion. Advances in neural information processing systems, 34, 14200-14213.

License and Usage Restrictions

Please ensure compliance with YouTube's terms of service when using this dataset. Some clips may no longer be available if the original videos have been removed or made private.