pianistprogrammer commited on
Commit
c02718b
Β·
verified Β·
1 Parent(s): 557ae6e

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +56 -3
README.md CHANGED
@@ -1,3 +1,56 @@
1
- ---
2
- license: cc0-1.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Dataset 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
+ 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.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
14
+ 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
15
+
16
+ # Define the dataset name on Hugging Face Hub
17
+ dataset_name = "pianistprogrammer/Meter2800"
18
+
19
+ # Define the paths to your CSV files within the Hugging Face repository
20
+ # These paths are relative to the root of the dataset folder on the Hub.
21
+ data_files = {
22
+ 'train_4_classes': 'data_train_4_classes.csv',
23
+ 'val_4_classes': 'data_val_4_classes.csv',
24
+ 'test_4_classes': 'data_test_4_classes.csv',
25
+ 'train_2_classes': 'data_train_2_classes.csv',
26
+ 'val_2_classes': 'data_val_2_classes.csv',
27
+ 'test_2_classes': 'data_test_2_classes.csv',
28
+ }
29
+
30
+ # Load a specific split, for example, the 'train_4_classes' split
31
+ # The 'filename' column in the CSVs will be automatically interpreted as audio paths.
32
+ dataset_train_4_classes = load_dataset(dataset_name, data_files=data_files, split='train_4_classes')
33
+
34
+ print(f"Dataset loaded successfully: {dataset_train_4_classes}")
35
+ print(f"First example from 'train_4_classes':\n{dataset_train_4_classes[0]}")
36
+
37
+ # Accessing the audio data:
38
+ first_example = dataset_train_4_classes[0]
39
+ print(f"\nAudio path: {first_example['filename']}")
40
+ print(f"Audio array (first 10 samples): {first_example['audio']['array'][:10]}")
41
+ print(f"Sampling rate: {first_example['audio']['sampling_rate']}")
42
+
43
+ # To load all splits as a DatasetDict:
44
+ dataset_dict = load_dataset(dataset_name, data_files=data_files)
45
+ print(f"\nLoaded all splits as a DatasetDict: {dataset_dict}")
46
+
47
+ # Accessing another split, e.g., test_2_classes
48
+ print(f"\nFirst example from 'test_2_classes':\n{dataset_dict['test_2_classes'][0]}")
49
+
50
+ 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,
51
+ author = {PianistProgrammer},
52
+ title = {{Meter2800}: A Dataset for Music Time signature detection / Meter Classification},
53
+ year = {2025},
54
+ publisher = {Hugging Face},
55
+ url = {https://huggingface.co/datasets/pianistprogrammer/Meter2800}
56
+ }