Datasets:

Modalities:
Audio
Image
Formats:
arrow
Size:
< 1K
Libraries:
Datasets
License:
admin commited on
Commit
90a803f
·
1 Parent(s): 2242c90
README.md CHANGED
@@ -11,7 +11,128 @@ tags:
11
  pretty_name: Musical Instruments Timbre Evaluation Database
12
  size_categories:
13
  - n<1K
14
- viewer: false
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  ---
16
 
17
  # Dataset Card for Chinese Musical Instruments Timbre Evaluation Database
@@ -78,7 +199,7 @@ for item in ds["Western"]:
78
 
79
  ## Maintenance
80
  ```bash
81
- git clone [email protected]:datasets/ccmusic-database/instrument_timbre
82
  cd instrument_timbre
83
  ```
84
 
 
11
  pretty_name: Musical Instruments Timbre Evaluation Database
12
  size_categories:
13
  - n<1K
14
+ dataset_info:
15
+ - config_name: default
16
+ features:
17
+ - name: audio
18
+ dtype:
19
+ audio:
20
+ sampling_rate: 44100
21
+ - name: mel
22
+ dtype: image
23
+ - name: instrument
24
+ dtype:
25
+ class_label:
26
+ names:
27
+ '0': gao_hu
28
+ '1': er_hu
29
+ '2': zhong_hu
30
+ '3': ge_hu
31
+ '4': di_yin_ge_hu
32
+ '5': jing_hu
33
+ '6': ban_hu
34
+ '7': bang_di
35
+ '8': qu_di
36
+ '9': xin_di
37
+ '10': da_di
38
+ '11': gao_yin_sheng
39
+ '12': zhong_yin_sheng
40
+ '13': di_yin_sheng
41
+ '14': gao_yin_suo_na
42
+ '15': zhong_yin_suo_na
43
+ '16': ci_zhong_yin_suo_na
44
+ '17': di_yin_suo_na
45
+ '18': gao_yin_guan
46
+ '19': zhong_yin_guan
47
+ '20': di_yin_guan
48
+ '21': bei_di_yin_guan
49
+ '22': ba_wu
50
+ '23': xun
51
+ '24': xiao
52
+ '25': liu_qin
53
+ '26': xiao_ruan
54
+ '27': pi_pa
55
+ '28': yang_qin
56
+ '29': zhong_ruan
57
+ '30': da_ruan
58
+ '31': gu_zheng
59
+ '32': gu_qin
60
+ '33': kong_hou
61
+ '34': san_xian
62
+ '35': yun_luo
63
+ '36': bian_zhong
64
+ '37': violin
65
+ '38': viola
66
+ '39': cello
67
+ '40': double_bass
68
+ '41': piccolo
69
+ '42': flute
70
+ '43': oboe
71
+ '44': clarinet
72
+ '45': bassoon
73
+ '46': saxophone
74
+ '47': trumpet
75
+ '48': trombone
76
+ '49': horn
77
+ '50': tuba
78
+ '51': harp
79
+ '52': tubular_bells
80
+ '53': bells
81
+ '54': xylophone
82
+ '55': vibraphone
83
+ '56': marimba
84
+ '57': piano
85
+ '58': clavichord
86
+ '59': accordion
87
+ '60': organ
88
+ - name: slim
89
+ dtype: float32
90
+ - name: bright
91
+ dtype: float32
92
+ - name: dark
93
+ dtype: float32
94
+ - name: sharp
95
+ dtype: float32
96
+ - name: thick
97
+ dtype: float32
98
+ - name: thin
99
+ dtype: float32
100
+ - name: vigorous
101
+ dtype: float32
102
+ - name: silvery
103
+ dtype: float32
104
+ - name: raspy
105
+ dtype: float32
106
+ - name: full
107
+ dtype: float32
108
+ - name: coarse
109
+ dtype: float32
110
+ - name: pure
111
+ dtype: float32
112
+ - name: hoarse
113
+ dtype: float32
114
+ - name: consonant
115
+ dtype: float32
116
+ - name: mellow
117
+ dtype: float32
118
+ - name: muddy
119
+ dtype: float32
120
+ splits:
121
+ - name: Chinese
122
+ num_bytes: 15902
123
+ num_examples: 37
124
+ - name: Western
125
+ num_bytes: 10308
126
+ num_examples: 24
127
+ download_size: 106658464
128
+ dataset_size: 26210
129
+ configs:
130
+ - config_name: default
131
+ data_files:
132
+ - split: Chinese
133
+ path: default/Chinese/data-*.arrow
134
+ - split: Western
135
+ path: default/Western/data-*.arrow
136
  ---
137
 
138
  # Dataset Card for Chinese Musical Instruments Timbre Evaluation Database
 
199
 
200
  ## Maintenance
201
  ```bash
202
+ GIT_LFS_SKIP_SMUDGE=1 git clone [email protected]:datasets/ccmusic-database/instrument_timbre
203
  cd instrument_timbre
204
  ```
205
 
default/Chinese/data-00000-of-00001.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a2d52813f7b5e2ff97496cc7df5bf917e5e7bed707af57585a5de62a32175799
3
+ size 42937568
default/Chinese/dataset_info.json ADDED
@@ -0,0 +1,199 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "builder_name": "instrument_timbre",
3
+ "citation": "",
4
+ "config_name": "default",
5
+ "dataset_name": "instrument_timbre",
6
+ "dataset_size": 26210,
7
+ "description": "",
8
+ "download_checksums": {
9
+ "https://www.modelscope.cn/datasets/ccmusic-database/instrument_timbre/resolve/master/data/audio.zip": {
10
+ "num_bytes": 105477166,
11
+ "checksum": null
12
+ },
13
+ "https://www.modelscope.cn/datasets/ccmusic-database/instrument_timbre/resolve/master/data/mel.zip": {
14
+ "num_bytes": 1172068,
15
+ "checksum": null
16
+ },
17
+ "https://www.modelscope.cn/datasets/ccmusic-database/instrument_timbre/resolve/master/data/Chinese.csv": {
18
+ "num_bytes": 7402,
19
+ "checksum": null
20
+ },
21
+ "https://www.modelscope.cn/datasets/ccmusic-database/instrument_timbre/resolve/master/data/Western.csv": {
22
+ "num_bytes": 1828,
23
+ "checksum": null
24
+ }
25
+ },
26
+ "download_size": 106658464,
27
+ "features": {
28
+ "audio": {
29
+ "sampling_rate": 44100,
30
+ "_type": "Audio"
31
+ },
32
+ "mel": {
33
+ "_type": "Image"
34
+ },
35
+ "instrument": {
36
+ "names": [
37
+ "gao_hu",
38
+ "er_hu",
39
+ "zhong_hu",
40
+ "ge_hu",
41
+ "di_yin_ge_hu",
42
+ "jing_hu",
43
+ "ban_hu",
44
+ "bang_di",
45
+ "qu_di",
46
+ "xin_di",
47
+ "da_di",
48
+ "gao_yin_sheng",
49
+ "zhong_yin_sheng",
50
+ "di_yin_sheng",
51
+ "gao_yin_suo_na",
52
+ "zhong_yin_suo_na",
53
+ "ci_zhong_yin_suo_na",
54
+ "di_yin_suo_na",
55
+ "gao_yin_guan",
56
+ "zhong_yin_guan",
57
+ "di_yin_guan",
58
+ "bei_di_yin_guan",
59
+ "ba_wu",
60
+ "xun",
61
+ "xiao",
62
+ "liu_qin",
63
+ "xiao_ruan",
64
+ "pi_pa",
65
+ "yang_qin",
66
+ "zhong_ruan",
67
+ "da_ruan",
68
+ "gu_zheng",
69
+ "gu_qin",
70
+ "kong_hou",
71
+ "san_xian",
72
+ "yun_luo",
73
+ "bian_zhong",
74
+ "violin",
75
+ "viola",
76
+ "cello",
77
+ "double_bass",
78
+ "piccolo",
79
+ "flute",
80
+ "oboe",
81
+ "clarinet",
82
+ "bassoon",
83
+ "saxophone",
84
+ "trumpet",
85
+ "trombone",
86
+ "horn",
87
+ "tuba",
88
+ "harp",
89
+ "tubular_bells",
90
+ "bells",
91
+ "xylophone",
92
+ "vibraphone",
93
+ "marimba",
94
+ "piano",
95
+ "clavichord",
96
+ "accordion",
97
+ "organ"
98
+ ],
99
+ "_type": "ClassLabel"
100
+ },
101
+ "slim": {
102
+ "dtype": "float32",
103
+ "_type": "Value"
104
+ },
105
+ "bright": {
106
+ "dtype": "float32",
107
+ "_type": "Value"
108
+ },
109
+ "dark": {
110
+ "dtype": "float32",
111
+ "_type": "Value"
112
+ },
113
+ "sharp": {
114
+ "dtype": "float32",
115
+ "_type": "Value"
116
+ },
117
+ "thick": {
118
+ "dtype": "float32",
119
+ "_type": "Value"
120
+ },
121
+ "thin": {
122
+ "dtype": "float32",
123
+ "_type": "Value"
124
+ },
125
+ "vigorous": {
126
+ "dtype": "float32",
127
+ "_type": "Value"
128
+ },
129
+ "silvery": {
130
+ "dtype": "float32",
131
+ "_type": "Value"
132
+ },
133
+ "raspy": {
134
+ "dtype": "float32",
135
+ "_type": "Value"
136
+ },
137
+ "full": {
138
+ "dtype": "float32",
139
+ "_type": "Value"
140
+ },
141
+ "coarse": {
142
+ "dtype": "float32",
143
+ "_type": "Value"
144
+ },
145
+ "pure": {
146
+ "dtype": "float32",
147
+ "_type": "Value"
148
+ },
149
+ "hoarse": {
150
+ "dtype": "float32",
151
+ "_type": "Value"
152
+ },
153
+ "consonant": {
154
+ "dtype": "float32",
155
+ "_type": "Value"
156
+ },
157
+ "mellow": {
158
+ "dtype": "float32",
159
+ "_type": "Value"
160
+ },
161
+ "muddy": {
162
+ "dtype": "float32",
163
+ "_type": "Value"
164
+ }
165
+ },
166
+ "homepage": "https://www.modelscope.cn/datasets/ccmusic-database/instrument_timbre",
167
+ "license": "CC-BY-NC-ND",
168
+ "size_in_bytes": 106684674,
169
+ "splits": {
170
+ "Chinese": {
171
+ "name": "Chinese",
172
+ "num_bytes": 15902,
173
+ "num_examples": 37,
174
+ "dataset_name": "instrument_timbre"
175
+ },
176
+ "Western": {
177
+ "name": "Western",
178
+ "num_bytes": 10308,
179
+ "num_examples": 24,
180
+ "dataset_name": "instrument_timbre"
181
+ }
182
+ },
183
+ "supervised_keys": {
184
+ "input": "audio",
185
+ "output": "instrument"
186
+ },
187
+ "task_templates": [
188
+ {
189
+ "task": "audio-classification",
190
+ "label_column": "instrument"
191
+ }
192
+ ],
193
+ "version": {
194
+ "version_str": "0.0.0",
195
+ "major": 0,
196
+ "minor": 0,
197
+ "patch": 0
198
+ }
199
+ }
default/Chinese/state.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_data_files": [
3
+ {
4
+ "filename": "data-00000-of-00001.arrow"
5
+ }
6
+ ],
7
+ "_fingerprint": "93fe712e33297421",
8
+ "_format_columns": null,
9
+ "_format_kwargs": {},
10
+ "_format_type": null,
11
+ "_output_all_columns": false,
12
+ "_split": "Chinese"
13
+ }
default/Western/data-00000-of-00001.arrow ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a793d7bbb031cdea3755c568a2991e1096ed726b64bda7b15f7a4bfb69713065
3
+ size 139964448
default/Western/dataset_info.json ADDED
@@ -0,0 +1,199 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "builder_name": "instrument_timbre",
3
+ "citation": "",
4
+ "config_name": "default",
5
+ "dataset_name": "instrument_timbre",
6
+ "dataset_size": 26210,
7
+ "description": "",
8
+ "download_checksums": {
9
+ "https://www.modelscope.cn/datasets/ccmusic-database/instrument_timbre/resolve/master/data/audio.zip": {
10
+ "num_bytes": 105477166,
11
+ "checksum": null
12
+ },
13
+ "https://www.modelscope.cn/datasets/ccmusic-database/instrument_timbre/resolve/master/data/mel.zip": {
14
+ "num_bytes": 1172068,
15
+ "checksum": null
16
+ },
17
+ "https://www.modelscope.cn/datasets/ccmusic-database/instrument_timbre/resolve/master/data/Chinese.csv": {
18
+ "num_bytes": 7402,
19
+ "checksum": null
20
+ },
21
+ "https://www.modelscope.cn/datasets/ccmusic-database/instrument_timbre/resolve/master/data/Western.csv": {
22
+ "num_bytes": 1828,
23
+ "checksum": null
24
+ }
25
+ },
26
+ "download_size": 106658464,
27
+ "features": {
28
+ "audio": {
29
+ "sampling_rate": 44100,
30
+ "_type": "Audio"
31
+ },
32
+ "mel": {
33
+ "_type": "Image"
34
+ },
35
+ "instrument": {
36
+ "names": [
37
+ "gao_hu",
38
+ "er_hu",
39
+ "zhong_hu",
40
+ "ge_hu",
41
+ "di_yin_ge_hu",
42
+ "jing_hu",
43
+ "ban_hu",
44
+ "bang_di",
45
+ "qu_di",
46
+ "xin_di",
47
+ "da_di",
48
+ "gao_yin_sheng",
49
+ "zhong_yin_sheng",
50
+ "di_yin_sheng",
51
+ "gao_yin_suo_na",
52
+ "zhong_yin_suo_na",
53
+ "ci_zhong_yin_suo_na",
54
+ "di_yin_suo_na",
55
+ "gao_yin_guan",
56
+ "zhong_yin_guan",
57
+ "di_yin_guan",
58
+ "bei_di_yin_guan",
59
+ "ba_wu",
60
+ "xun",
61
+ "xiao",
62
+ "liu_qin",
63
+ "xiao_ruan",
64
+ "pi_pa",
65
+ "yang_qin",
66
+ "zhong_ruan",
67
+ "da_ruan",
68
+ "gu_zheng",
69
+ "gu_qin",
70
+ "kong_hou",
71
+ "san_xian",
72
+ "yun_luo",
73
+ "bian_zhong",
74
+ "violin",
75
+ "viola",
76
+ "cello",
77
+ "double_bass",
78
+ "piccolo",
79
+ "flute",
80
+ "oboe",
81
+ "clarinet",
82
+ "bassoon",
83
+ "saxophone",
84
+ "trumpet",
85
+ "trombone",
86
+ "horn",
87
+ "tuba",
88
+ "harp",
89
+ "tubular_bells",
90
+ "bells",
91
+ "xylophone",
92
+ "vibraphone",
93
+ "marimba",
94
+ "piano",
95
+ "clavichord",
96
+ "accordion",
97
+ "organ"
98
+ ],
99
+ "_type": "ClassLabel"
100
+ },
101
+ "slim": {
102
+ "dtype": "float32",
103
+ "_type": "Value"
104
+ },
105
+ "bright": {
106
+ "dtype": "float32",
107
+ "_type": "Value"
108
+ },
109
+ "dark": {
110
+ "dtype": "float32",
111
+ "_type": "Value"
112
+ },
113
+ "sharp": {
114
+ "dtype": "float32",
115
+ "_type": "Value"
116
+ },
117
+ "thick": {
118
+ "dtype": "float32",
119
+ "_type": "Value"
120
+ },
121
+ "thin": {
122
+ "dtype": "float32",
123
+ "_type": "Value"
124
+ },
125
+ "vigorous": {
126
+ "dtype": "float32",
127
+ "_type": "Value"
128
+ },
129
+ "silvery": {
130
+ "dtype": "float32",
131
+ "_type": "Value"
132
+ },
133
+ "raspy": {
134
+ "dtype": "float32",
135
+ "_type": "Value"
136
+ },
137
+ "full": {
138
+ "dtype": "float32",
139
+ "_type": "Value"
140
+ },
141
+ "coarse": {
142
+ "dtype": "float32",
143
+ "_type": "Value"
144
+ },
145
+ "pure": {
146
+ "dtype": "float32",
147
+ "_type": "Value"
148
+ },
149
+ "hoarse": {
150
+ "dtype": "float32",
151
+ "_type": "Value"
152
+ },
153
+ "consonant": {
154
+ "dtype": "float32",
155
+ "_type": "Value"
156
+ },
157
+ "mellow": {
158
+ "dtype": "float32",
159
+ "_type": "Value"
160
+ },
161
+ "muddy": {
162
+ "dtype": "float32",
163
+ "_type": "Value"
164
+ }
165
+ },
166
+ "homepage": "https://www.modelscope.cn/datasets/ccmusic-database/instrument_timbre",
167
+ "license": "CC-BY-NC-ND",
168
+ "size_in_bytes": 106684674,
169
+ "splits": {
170
+ "Chinese": {
171
+ "name": "Chinese",
172
+ "num_bytes": 15902,
173
+ "num_examples": 37,
174
+ "dataset_name": "instrument_timbre"
175
+ },
176
+ "Western": {
177
+ "name": "Western",
178
+ "num_bytes": 10308,
179
+ "num_examples": 24,
180
+ "dataset_name": "instrument_timbre"
181
+ }
182
+ },
183
+ "supervised_keys": {
184
+ "input": "audio",
185
+ "output": "instrument"
186
+ },
187
+ "task_templates": [
188
+ {
189
+ "task": "audio-classification",
190
+ "label_column": "instrument"
191
+ }
192
+ ],
193
+ "version": {
194
+ "version_str": "0.0.0",
195
+ "major": 0,
196
+ "minor": 0,
197
+ "patch": 0
198
+ }
199
+ }
default/Western/state.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_data_files": [
3
+ {
4
+ "filename": "data-00000-of-00001.arrow"
5
+ }
6
+ ],
7
+ "_fingerprint": "d79e4c99ed74e94d",
8
+ "_format_columns": null,
9
+ "_format_kwargs": {},
10
+ "_format_type": null,
11
+ "_output_all_columns": false,
12
+ "_split": "Western"
13
+ }
default/dataset_dict.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"splits": ["Chinese", "Western"]}
instrument_timbre.py DELETED
@@ -1,192 +0,0 @@
1
- import os
2
- import datasets
3
- import pandas as pd
4
- from datasets.tasks import AudioClassification
5
-
6
-
7
- _NAMES = [
8
- # Chinese 0-36
9
- "gao_hu",
10
- "er_hu",
11
- "zhong_hu",
12
- "ge_hu",
13
- "di_yin_ge_hu",
14
- "jing_hu",
15
- "ban_hu",
16
- "bang_di",
17
- "qu_di",
18
- "xin_di",
19
- "da_di",
20
- "gao_yin_sheng",
21
- "zhong_yin_sheng",
22
- "di_yin_sheng",
23
- "gao_yin_suo_na",
24
- "zhong_yin_suo_na",
25
- "ci_zhong_yin_suo_na",
26
- "di_yin_suo_na",
27
- "gao_yin_guan",
28
- "zhong_yin_guan",
29
- "di_yin_guan",
30
- "bei_di_yin_guan",
31
- "ba_wu",
32
- "xun",
33
- "xiao",
34
- "liu_qin",
35
- "xiao_ruan",
36
- "pi_pa",
37
- "yang_qin",
38
- "zhong_ruan",
39
- "da_ruan",
40
- "gu_zheng",
41
- "gu_qin",
42
- "kong_hou",
43
- "san_xian",
44
- "yun_luo",
45
- "bian_zhong",
46
- # Western 37-60
47
- "violin",
48
- "viola",
49
- "cello",
50
- "double_bass",
51
- "piccolo",
52
- "flute",
53
- "oboe",
54
- "clarinet",
55
- "bassoon",
56
- "saxophone",
57
- "trumpet",
58
- "trombone",
59
- "horn",
60
- "tuba",
61
- "harp",
62
- "tubular_bells",
63
- "bells",
64
- "xylophone",
65
- "vibraphone",
66
- "marimba",
67
- "piano",
68
- "clavichord",
69
- "accordion",
70
- "organ",
71
- ]
72
-
73
- _HOMEPAGE = f"https://www.modelscope.cn/datasets/ccmusic-database/{os.path.basename(__file__)[:-3]}"
74
-
75
- _DOMAIN = f"{_HOMEPAGE}/resolve/master/data"
76
-
77
- _URLS = {
78
- "audio": f"{_DOMAIN}/audio.zip",
79
- "mel": f"{_DOMAIN}/mel.zip",
80
- "Chinese": f"{_DOMAIN}/Chinese.csv",
81
- "Western": f"{_DOMAIN}/Western.csv",
82
- }
83
-
84
-
85
- class instrument_timbre(datasets.GeneratorBasedBuilder):
86
- def _info(self):
87
- return datasets.DatasetInfo(
88
- features=datasets.Features(
89
- {
90
- "audio": datasets.Audio(sampling_rate=44100),
91
- "mel": datasets.Image(),
92
- "instrument": datasets.features.ClassLabel(names=_NAMES),
93
- "slim": datasets.Value("float32"),
94
- "bright": datasets.Value("float32"),
95
- "dark": datasets.Value("float32"),
96
- "sharp": datasets.Value("float32"),
97
- "thick": datasets.Value("float32"),
98
- "thin": datasets.Value("float32"),
99
- "vigorous": datasets.Value("float32"),
100
- "silvery": datasets.Value("float32"),
101
- "raspy": datasets.Value("float32"),
102
- "full": datasets.Value("float32"),
103
- "coarse": datasets.Value("float32"),
104
- "pure": datasets.Value("float32"),
105
- "hoarse": datasets.Value("float32"),
106
- "consonant": datasets.Value("float32"),
107
- "mellow": datasets.Value("float32"),
108
- "muddy": datasets.Value("float32"),
109
- }
110
- ),
111
- supervised_keys=("audio", "instrument"),
112
- homepage=_HOMEPAGE,
113
- license="CC-BY-NC-ND",
114
- version="1.2.0",
115
- task_templates=[
116
- AudioClassification(
117
- task="audio-classification",
118
- audio_column="audio",
119
- label_column="instrument",
120
- )
121
- ],
122
- )
123
-
124
- def _split_generators(self, dl_manager):
125
- audio_files = dl_manager.download_and_extract(_URLS["audio"])
126
- mel_files = dl_manager.download_and_extract(_URLS["mel"])
127
- cn_ins_eval = dl_manager.download(_URLS["Chinese"])
128
- en_ins_eval = dl_manager.download(_URLS["Western"])
129
- cn_labels = pd.read_csv(cn_ins_eval, index_col="instrument_id")
130
- en_labels = pd.read_csv(en_ins_eval, index_col="instrument_id")
131
- cn_dataset, en_dataset = {}, {}
132
- for path in dl_manager.iter_files([audio_files]):
133
- fname: str = os.path.basename(path)
134
- i = int(fname.split(".wa")[0]) - 1
135
- if fname.endswith(".wav"):
136
- region = os.path.basename(os.path.dirname(path))
137
- labels = cn_labels if region == "Chinese" else en_labels
138
- data = {
139
- "audio": path,
140
- "mel": "",
141
- "instrument": labels.iloc[i]["instrument_name"],
142
- "slim": labels.iloc[i]["slim"],
143
- "bright": labels.iloc[i]["bright"],
144
- "dark": labels.iloc[i]["dim"],
145
- "sharp": labels.iloc[i]["sharp"],
146
- "thick": labels.iloc[i]["thick"],
147
- "thin": labels.iloc[i]["thin"],
148
- "vigorous": labels.iloc[i]["solid"],
149
- "silvery": labels.iloc[i]["clear"],
150
- "raspy": labels.iloc[i]["dry"],
151
- "full": labels.iloc[i]["plump"],
152
- "coarse": labels.iloc[i]["rough"],
153
- "pure": labels.iloc[i]["pure"],
154
- "hoarse": labels.iloc[i]["hoarse"],
155
- "consonant": labels.iloc[i]["harmonious"],
156
- "mellow": labels.iloc[i]["soft"],
157
- "muddy": labels.iloc[i]["turbid"],
158
- }
159
- if region == "Chinese":
160
- cn_dataset[i] = data
161
-
162
- else:
163
- en_dataset[i] = data
164
-
165
- for path in dl_manager.iter_files([mel_files]):
166
- fname = os.path.basename(path)
167
- i = int(fname.split(".jp")[0]) - 1
168
- if fname.endswith(".jpg"):
169
- if os.path.basename(os.path.dirname(path)) == "Chinese":
170
- cn_dataset[i]["mel"] = path
171
-
172
- else:
173
- en_dataset[i]["mel"] = path
174
-
175
- return [
176
- datasets.SplitGenerator(
177
- name="Chinese",
178
- gen_kwargs={
179
- "files": [cn_dataset[k] for k in sorted(cn_dataset)],
180
- },
181
- ),
182
- datasets.SplitGenerator(
183
- name="Western",
184
- gen_kwargs={
185
- "files": [en_dataset[k] for k in sorted(en_dataset)],
186
- },
187
- ),
188
- ]
189
-
190
- def _generate_examples(self, files):
191
- for i, path in enumerate(files):
192
- yield i, path