Datasets:
admin
commited on
Commit
·
fa99664
1
Parent(s):
377cc78
upl base
Browse files- .gitignore +5 -0
- README.md +128 -0
- timbre_range.py +107 -0
.gitignore
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
rename.sh
|
2 |
+
test.py
|
3 |
+
*.wav
|
4 |
+
*.txt
|
5 |
+
*.jpg
|
README.md
CHANGED
@@ -1,3 +1,131 @@
|
|
1 |
---
|
2 |
license: mit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: mit
|
3 |
+
task_categories:
|
4 |
+
- audio-classification
|
5 |
+
language:
|
6 |
+
- zh
|
7 |
+
- en
|
8 |
+
tags:
|
9 |
+
- music
|
10 |
+
- art
|
11 |
+
pretty_name: Timbre and Range Dataset
|
12 |
+
size_categories:
|
13 |
+
- 1K<n<10K
|
14 |
+
viewer: false
|
15 |
---
|
16 |
+
|
17 |
+
# Dataset Card for Timbre and Range Dataset
|
18 |
+
## Dataset Summary
|
19 |
+
The timbre dataset contains acapella singing audio of 9 singers, as well as cut single-note audio, totaling 775 clips (.wav format)
|
20 |
+
The vocal range dataset includes several up and down chromatic scales audio clips of several vocals, as well as the cut single-note audio clips (.wav format).
|
21 |
+
|
22 |
+
### Supported Tasks and Leaderboards
|
23 |
+
Audio classification
|
24 |
+
|
25 |
+
### Languages
|
26 |
+
Chinese, English
|
27 |
+
|
28 |
+
## Dataset Structure
|
29 |
+
<https://www.modelscope.cn/datasets/ccmusic-database/timbre_range/dataPeview>
|
30 |
+
### Data Instances
|
31 |
+
.zip(.wav, .jpg), .csv
|
32 |
+
|
33 |
+
### Data Fields
|
34 |
+
```txt
|
35 |
+
timbre: song1-32
|
36 |
+
range: vox1_19-22/26-29/32/33/36-38/41-47/51-55/59-64/69-71/79-81
|
37 |
+
```
|
38 |
+
|
39 |
+
### Data Splits
|
40 |
+
Train, Validation, Test
|
41 |
+
|
42 |
+
## Usage
|
43 |
+
### Timbre subset
|
44 |
+
```python
|
45 |
+
from datasets import load_dataset
|
46 |
+
|
47 |
+
ds = load_dataset("ccmusic-database/timbre_range", name="timbre")
|
48 |
+
for item in ds["train"]:
|
49 |
+
print(item)
|
50 |
+
|
51 |
+
for item in ds["validation"]:
|
52 |
+
print(item)
|
53 |
+
|
54 |
+
for item in ds["test"]:
|
55 |
+
print(item)
|
56 |
+
```
|
57 |
+
|
58 |
+
### Range subset
|
59 |
+
```python
|
60 |
+
from datasets import load_dataset
|
61 |
+
# default subset
|
62 |
+
ds = load_dataset("ccmusic-database/timbre_range", name="range")
|
63 |
+
for item in ds["train"]:
|
64 |
+
print(item)
|
65 |
+
|
66 |
+
for item in ds["validation"]:
|
67 |
+
print(item)
|
68 |
+
|
69 |
+
for item in ds["test"]:
|
70 |
+
print(item)
|
71 |
+
```
|
72 |
+
|
73 |
+
## Maintenance
|
74 |
+
```bash
|
75 |
+
git clone [email protected]:datasets/ccmusic-database/timbre_range
|
76 |
+
cd timbre_range
|
77 |
+
```
|
78 |
+
|
79 |
+
## Dataset Creation
|
80 |
+
### Curation Rationale
|
81 |
+
Promoting the development of music AI industry
|
82 |
+
|
83 |
+
### Source Data
|
84 |
+
#### Initial Data Collection and Normalization
|
85 |
+
Zijin Li, Zhaorui Liu, Monan Zhou
|
86 |
+
|
87 |
+
#### Who are the source language producers?
|
88 |
+
Composers of the songs in dataset
|
89 |
+
|
90 |
+
### Annotations
|
91 |
+
#### Annotation process
|
92 |
+
CCMUSIC students collected acapella singing audios of 9 singers, as well as cut single-note audio, totaling 775 clips
|
93 |
+
|
94 |
+
#### Who are the annotators?
|
95 |
+
Students from CCMUSIC
|
96 |
+
|
97 |
+
### Personal and Sensitive Information
|
98 |
+
Due to copyright issues with the original music, only acapella singing audios are provided in the dataset
|
99 |
+
|
100 |
+
## Considerations for Using the Data
|
101 |
+
### Social Impact of Dataset
|
102 |
+
Promoting the development of AI in the music industry
|
103 |
+
|
104 |
+
### Discussion of Biases
|
105 |
+
Most are Chinese songs
|
106 |
+
|
107 |
+
### Other Known Limitations
|
108 |
+
Samples are not balanced enough
|
109 |
+
|
110 |
+
## Mirror
|
111 |
+
<https://www.modelscope.cn/datasets/ccmusic-database/timbre_range>
|
112 |
+
|
113 |
+
## Additional Information
|
114 |
+
### Dataset Curators
|
115 |
+
Zijin Li
|
116 |
+
|
117 |
+
### Evaluation
|
118 |
+
[1] [Yiliang, J. et al. (2019) ‘Data Augmentation based Convolutional Neural Network for Auscultation’, Journal of Fudan University(Natural Science), pp. 328–334. doi:10.15943/j.cnki.fdxb-jns.2019.03.004.](https://kns.cnki.net/kcms/detail/detail.aspx?dbcode=CJFD&dbname=CJFDLAST2019&filename=FDXB201903004&uniplatform=NZKPT&v=VAszHDtjPUYMi3JYVrdSGx4fcqlEtgCeKwRGTacCj98CGEQg5CUFHxakrvuaMzm3)
|
119 |
+
|
120 |
+
### Citation Information
|
121 |
+
```bibtex
|
122 |
+
@article{2019Data,
|
123 |
+
title={Data Augmentation based Convolutional Neural Network for Auscultation},
|
124 |
+
author={ Yiliang, Jiang and Xulong, Zhang and Jin, Deng and Wenqiang, Zhang and Wei, L. I. },
|
125 |
+
journal={Journal of Fudan University(Natural Science)},
|
126 |
+
year={2019},
|
127 |
+
}
|
128 |
+
```
|
129 |
+
|
130 |
+
### Contributions
|
131 |
+
Provide a dataset for music timbre and range
|
timbre_range.py
ADDED
@@ -0,0 +1,107 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
import random
|
3 |
+
import datasets
|
4 |
+
import pandas as pd
|
5 |
+
from datasets.tasks import AudioClassification
|
6 |
+
|
7 |
+
|
8 |
+
_NAMES = {
|
9 |
+
"timbre": ["Base", "Split", "Short"],
|
10 |
+
"range": ["Narrow", "Moderate", "Wide"],
|
11 |
+
}
|
12 |
+
|
13 |
+
_URL = f"https://www.modelscope.cn/datasets/ccmusic-database/{os.path.basename(__file__)[:-3]}/resolve/master/data"
|
14 |
+
|
15 |
+
|
16 |
+
class timbre_range(datasets.GeneratorBasedBuilder):
|
17 |
+
def _info(self):
|
18 |
+
if self.config.name == "default":
|
19 |
+
self.config.name = "range"
|
20 |
+
|
21 |
+
return datasets.DatasetInfo(
|
22 |
+
features=datasets.Features(
|
23 |
+
{
|
24 |
+
"audio": datasets.Audio(sampling_rate=44_100),
|
25 |
+
"mel": datasets.Image(),
|
26 |
+
"label": datasets.features.ClassLabel(names=_NAMES["timbre"]),
|
27 |
+
"score1": datasets.Value("float64"),
|
28 |
+
"score2": datasets.Value("float64"),
|
29 |
+
"avg_score": datasets.Value("float64"),
|
30 |
+
}
|
31 |
+
if self.config.name == "timbre"
|
32 |
+
else {
|
33 |
+
"audio": datasets.Audio(sampling_rate=44_100),
|
34 |
+
"mel": datasets.Image(),
|
35 |
+
"label": datasets.features.ClassLabel(names=_NAMES["range"]),
|
36 |
+
}
|
37 |
+
),
|
38 |
+
supervised_keys=("audio", "label"),
|
39 |
+
license="CC-BY-NC-ND",
|
40 |
+
version="1.2.0",
|
41 |
+
task_templates=[
|
42 |
+
AudioClassification(
|
43 |
+
task="audio-classification",
|
44 |
+
audio_column="audio",
|
45 |
+
label_column="label",
|
46 |
+
)
|
47 |
+
],
|
48 |
+
)
|
49 |
+
|
50 |
+
def _split_generators(self, dl_manager):
|
51 |
+
dataset = []
|
52 |
+
data_files = dl_manager.download_and_extract(f"{_URL}/{self.config.name}.zip")
|
53 |
+
for fpath in dl_manager.iter_files([data_files]):
|
54 |
+
if os.path.basename(fpath).endswith(".wav"):
|
55 |
+
dataset.append(fpath)
|
56 |
+
|
57 |
+
random.shuffle(dataset)
|
58 |
+
count = len(dataset)
|
59 |
+
p80 = int(0.8 * count)
|
60 |
+
p90 = int(0.9 * count)
|
61 |
+
|
62 |
+
csv_file = dl_manager.download(f"{_URL}/{self.config.name}.csv")
|
63 |
+
labels = pd.read_csv(csv_file, index_col="id")
|
64 |
+
|
65 |
+
return [
|
66 |
+
datasets.SplitGenerator(
|
67 |
+
name=datasets.Split.TRAIN,
|
68 |
+
gen_kwargs={"files": dataset[:p80], "labels": labels},
|
69 |
+
),
|
70 |
+
datasets.SplitGenerator(
|
71 |
+
name=datasets.Split.VALIDATION,
|
72 |
+
gen_kwargs={"files": dataset[p80:p90], "labels": labels},
|
73 |
+
),
|
74 |
+
datasets.SplitGenerator(
|
75 |
+
name=datasets.Split.TEST,
|
76 |
+
gen_kwargs={"files": dataset[p90:], "labels": labels},
|
77 |
+
),
|
78 |
+
]
|
79 |
+
|
80 |
+
def _generate_examples(self, files, labels):
|
81 |
+
if self.config.name == "timbre":
|
82 |
+
for i, fpath in enumerate(files):
|
83 |
+
id: str = os.path.basename(fpath)[:-4]
|
84 |
+
if "-" in id:
|
85 |
+
id = id.split("-")[0]
|
86 |
+
|
87 |
+
yield i, {
|
88 |
+
"audio": fpath,
|
89 |
+
"mel": fpath.replace("/audios/", "/images/")
|
90 |
+
.replace("\\audios\\", "\\images\\")
|
91 |
+
.replace(".wav", ".jpg"),
|
92 |
+
"label": os.path.basename(os.path.dirname(fpath)).capitalize(),
|
93 |
+
"score1": float(labels.loc[id]["score1"]),
|
94 |
+
"score2": float(labels.loc[id]["score2"]),
|
95 |
+
"avg_score": float(labels.loc[id]["avg_score"]),
|
96 |
+
}
|
97 |
+
|
98 |
+
else:
|
99 |
+
for i, fpath in enumerate(files):
|
100 |
+
id = os.path.basename(fpath)[:-4]
|
101 |
+
yield i, {
|
102 |
+
"audio": fpath,
|
103 |
+
"mel": fpath.replace("/audios/", "/images/")
|
104 |
+
.replace("\\audios\\", "\\images\\")
|
105 |
+
.replace(".wav", ".jpg"),
|
106 |
+
"label": _NAMES["range"][int(labels.loc[id]["range"])],
|
107 |
+
}
|