pianistprogrammer commited on
Commit
4da394b
Β·
1 Parent(s): 8b20842

Refactor README.md to improve dataset structure, description, and metadata organization

Browse files
Files changed (1) hide show
  1. README.md +89 -47
README.md CHANGED
@@ -1,60 +1,102 @@
1
- pretty_name: Meter2800tags:audiomusicclassificationmetermulti-class-classificationmulti-label-classificationdatasets:GTZANMAGFMAOWNlicense: mitlanguages:enconfigs:data_test_4_classesdata_test_2_classesdata_train_4_classesdata_train_2_classesdata_val_4_classesdata_val_2_classesDataset Card for Meter2800Dataset DescriptionThe Meter2800 dataset is a collection of music audio files intended for tasks such as music genre classification and meter classification. It comprises 2800 audio samples, categorized into various genres and annotated with meter information. This dataset is designed to facilitate research in music information retrieval, particularly focusing on rhythmic and structural aspects of music.Dataset StructureThe dataset is organized as follows within the repository:Meter2800/
2
- β”œβ”€β”€ GTZAN/ # Contains WAV audio files from the GTZAN dataset
3
- β”œβ”€β”€ MAG/ # Contains WAV audio files from the MAG dataset
4
- β”œβ”€β”€ OWN/ # Contains WAV audio files from the OWN dataset
5
- β”œβ”€β”€ FMA/ # Contains WAV audio files from the FMA dataset
6
- β”œβ”€β”€ data_test_4_classes.csv
7
- β”œβ”€β”€ data_test_2_classes.csv
8
- β”œβ”€β”€ data_train_4_classes.csv
9
- β”œβ”€β”€ data_train_2_classes.csv
10
- β”œβ”€β”€ data_val_4_classes.csv
11
- β”œβ”€β”€ data_val_2_classes.csv
12
- └── README.md # This file
 
 
 
 
 
 
 
 
 
 
 
13
 
14
- All audio files are in .wav format, having been pre-processed and converted from their original formats (e.g., MP3) to ensure uniformity.Splits and ClassesThe dataset is divided into training, validation, and testing sets, available in two different class configurations:4-Class Classification:data_train_4_classes.csv: Training set metadata.data_val_4_classes.csv: Validation set metadata.data_test_4_classes.csv: Test set metadata.2-Class Classification:data_train_2_classes.csv: Training set metadata.data_val_2_classes.csv: Validation set metadata.data_test_2_classes.csv: Test set metadata.Each CSV file contains columns such as filename, label, meter, and alt_meter. The filename column specifies the relative path to the audio file within the dataset repository (e.e.g., /GTZAN/rock.00056.wav).Total Number of Files: Across the data_test_4_classes.csv, data_train_4_classes.csv, and data_val_4_classes.csv splits, there is a combined total of 2800 unique audio entries.Audio FilesThe audio files are 16-bit WAV files. The datasets library handles the loading of these audio files automatically when referenced in the filename column of the CSVs.Loading the DatasetYou can easily load this dataset using the Hugging Face datasets library.PrerequisitesEnsure you have the necessary libraries installed:pip install datasets pandas soundfile librosa
15
 
16
- Additionally, the datasets library relies on ffmpeg for audio processing. Please ensure ffmpeg is installed on your system and accessible in your environment's PATH.Loading Code ExampleTo load a specific split (e.g., train_4_classes), you can use the following Python code:from datasets import load_dataset, Audio
17
 
18
- # Define the dataset name on Hugging Face Hub
19
- dataset_name = "pianistprogrammer/Meter2800"
20
 
21
- # Define the paths to your CSV files within the Hugging Face repository
22
- # These paths are relative to the root of the dataset folder on the Hub.
23
- data_files = {
24
- 'train_4_classes': 'data_train_4_classes.csv',
25
- 'val_4_classes': 'data_val_4_classes.csv',
26
- 'test_4_classes': 'data_test_4_classes.csv',
27
- 'train_2_classes': 'data_train_2_classes.csv',
28
- 'val_2_classes': 'data_val_2_classes.csv',
29
- 'test_2_classes': 'data_2_classes.csv',
30
- }
 
 
31
 
32
- # Load a specific split, for example, the 'train_4_classes' split
33
- # The 'filename' column in the CSVs will be automatically interpreted as audio paths.
34
- dataset_train_4_classes = load_dataset(dataset_name, data_files=data_files, split='train_4_classes')
 
 
 
 
 
 
 
 
 
 
35
 
36
- print(f"Dataset loaded successfully: {dataset_train_4_classes}")
37
- print(f"First example from 'train_4_classes':\n{dataset_train_4_classes[0]}")
38
 
39
- # Accessing the audio data:
40
- first_example = dataset_train_4_classes[0]
41
- print(f"\nAudio path: {first_example['filename']}")
42
- print(f"Audio array (first 10 samples): {first_example['audio']['array'][:10]}")
43
- print(f"Sampling rate: {first_example['audio']['sampling_rate']}")
44
 
45
- # To load all splits as a DatasetDict:
46
- dataset_dict = load_dataset(dataset_name, data_files=data_files)
47
- print(f"\nLoaded all splits as a DatasetDict: {dataset_dict}")
48
 
49
- # Accessing another split, e.g., test_2_classes
50
- print(f"\nFirst example from 'test_2_classes':\n{dataset_dict['test_2_classes'][0]}")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
 
52
 
53
- Key Features and UsageAutomatic Audio Loading: When you access an example, the audio column will automatically contain the loaded audio as a NumPy array (array) and its sampling_rate.Flexible Splits: You can load specific splits or the entire DatasetDict to manage your training, validation, and testing pipelines.Metadata Integration: The CSVs provide rich metadata (label, meter, alt_meter) alongside the audio paths, enabling diverse machine learning tasks.Citation@misc{meter2800_dataset,
54
- author = {PianistProgrammer},
55
- title = {{Meter2800}: A Dataset for Music Genre and Meter Classification},
56
- year = {2025},
57
- publisher = {Hugging Face},
58
- url = {https://huggingface.co/datasets/pianistprogrammer/Meter2800}
59
  }
60
 
 
 
1
+ ---
2
+ pretty_name: "Meter2800"
3
+ language:
4
+ - en
5
+ tags:
6
+ - audio
7
+ - music-classification
8
+ - meter-classification
9
+ - multi-class-classification
10
+ - multi-label-classification
11
+ license: mit
12
+ task_categories:
13
+ - audio-classification
14
+ - audio-tagging
15
+ dataset_info:
16
+ size_categories:
17
+ - 1K<n<10K
18
+ source_datasets:
19
+ - gtzan
20
+ - mag
21
+ - own
22
+ - fma
23
+ ---
24
 
25
+ # Meter2800
26
 
27
+ **Dataset for music genre and meter (rhythm) classification**, combining tracks from GTZAN, MAG, OWN, and FMA.
28
 
29
+ ## Dataset Description
 
30
 
31
+ Meter2800 is a curated collection of 2,800 `.wav` music audio samples, each annotated with **genre** and **meter** (and optionally `alt_meter`). It supports both:
32
+
33
+ - **4-class classification** (e.g., 4 genres),
34
+ - **2-class classification** (binary genre labeling).
35
+
36
+ Split into train/val/test sets with clear metadata in CSV.
37
+
38
+ Intended for music information retrieval tasks like rhythmic / structural analysis and genre prediction.
39
+
40
+ ## Supported Tasks and Usage
41
+
42
+ Load the dataset via the `datasets` library with automatic audio decoding:
43
 
44
+ ```python
45
+ from datasets import load_dataset, Audio
46
+ dataset = load_dataset(
47
+ "pianistprogrammer/Meter2800",
48
+ data_files={
49
+ "train_4": "data_train_4_classes.csv",
50
+ "val_4": "data_val_4_classes.csv",
51
+ "test_4": "data_test_4_classes.csv",
52
+ "train_2": "data_train_2_classes.csv",
53
+ "val_2": "data_val_2_classes.csv",
54
+ "test_2": "data_test_2_classes.csv"
55
+ }
56
+ )
57
 
58
+ Each entry in the dataset contains:
 
59
 
60
+ - **filename**: Path to the audio file.
61
+ - **label**: Genre label (multi-class or binary, depending on split).
62
+ - **meter**: Primary meter annotation (e.g., 4/4, 3/4).
63
+ - **alt_meter**: Optional alternative meter annotation.
64
+ - **audio**: Audio data as a NumPy array and its sampling rate.
65
 
66
+ The dataset is organized into the following splits:
 
 
67
 
68
+ - `train_4`, `val_4`, `test_4`: For 4-class genre classification.
69
+ - `train_2`, `val_2`, `test_2`: For 2-class (binary) genre classification.
70
+
71
+ All splits are provided as CSV files referencing the audio files in the corresponding folders (`GTZAN/`, `MAG/`, `OWN/`, `FMA/`).
72
+
73
+ Example row in a CSV file:
74
+
75
+ | filename | label | meter | alt_meter |
76
+ |-------------------------|---------|-------|-----------|
77
+ | GTZAN/blues.00000.wav | blues | 4/4 | 12/8 |
78
+
79
+
80
+ Meter2800/
81
+ β”œβ”€β”€ GTZAN/
82
+ β”œβ”€β”€ MAG/
83
+ β”œβ”€β”€ OWN/
84
+ β”œβ”€β”€ FMA/
85
+ β”œβ”€β”€ data_train_4_classes.csv
86
+ β”œβ”€β”€ data_val_4_classes.csv
87
+ β”œβ”€β”€ data_test_4_classes.csv
88
+ β”œβ”€β”€ data_train_2_classes.csv
89
+ β”œβ”€β”€ data_val_2_classes.csv
90
+ β”œβ”€β”€ data_test_2_classes.csv
91
+ └── README.md
92
 
93
 
94
+ @misc{meter2800_dataset,
95
+ author = {PianistProgrammer},
96
+ title = {{Meter2800}: A Dataset for Music Genre and Meter Classification},
97
+ year = {2025},
98
+ publisher = {Hugging Face},
99
+ url = {https://huggingface.co/datasets/pianistprogrammer/Meter2800}
100
  }
101
 
102
+ license: "CC0 1.0 Public Domain"