MahiA commited on
Commit
f30aa49
·
verified ·
1 Parent(s): ce67156

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +43 -0
README.md ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ ---
4
+
5
+
6
+
7
+ # NS-Instruments
8
+
9
+ This is an audio classification dataset for **Music Instruments Classification**.
10
+
11
+ **Classes = 10   ,   Split = Train-Test**
12
+
13
+ ## Structure
14
+
15
+ - `audios` folder contains audio files.
16
+ - `train.csv` for training split and `test.csv` for the testing split.
17
+
18
+ ## Download
19
+ ```python
20
+ import os
21
+ import zipfile
22
+ import shutil
23
+ import huggingface_hub
24
+ audio_datasets_path = "DATASET_PATH/Audio-Datasets"
25
+ if not os.path.exists(audio_datasets_path): print(f"Given {audio_datasets_path=} does not exist. Specify a valid path ending with 'Audio-Datasets' folder.")
26
+ huggingface_hub.snapshot_download(repo_id="MahiA/NS-Instruments", repo_type="dataset", local_dir=os.path.join(audio_datasets_path, "NS-Instruments"))
27
+ zipfile_path = os.path.join(audio_datasets_path, 'NS-Instruments', 'NS-Instruments.zip')
28
+ with zipfile.ZipFile(zipfile_path,"r") as zip_ref:
29
+ zip_ref.extractall(os.path.join(audio_datasets_path, 'NS-Instruments'))
30
+ shutil.move(os.path.join(audio_datasets_path, 'NS-Instruments','NS-Instruments', 'audios'), os.path.join(audio_datasets_path, 'NS-Instruments'))
31
+ shutil.move(os.path.join(audio_datasets_path, 'NS-Instruments','NS-Instruments', 'train.csv'), os.path.join(audio_datasets_path, 'NS-Instruments'))
32
+ shutil.move(os.path.join(audio_datasets_path, 'NS-Instruments','NS-Instruments', 'test.csv'), os.path.join(audio_datasets_path, 'NS-Instruments'))
33
+ shutil.rmtree(os.path.join(audio_datasets_path, 'NS-Instruments', 'NS-Instruments'))
34
+ os.remove(zipfile_path)
35
+ ```
36
+
37
+ ## Acknowledgment
38
+
39
+ This dataset is a slightly processed/restructured version of data originally released by [Source](https://magenta.tensorflow.org/datasets/nsynth).<br>
40
+ Please refer to the respective source for their licensing details and any additional information.
41
+
42
+ ## Contact
43
+ For questions or feedback, please create an issue.