mika commited on
Commit ·
aa49123
1
Parent(s): 9e8bd03
change loadscript
Browse files- spectrogram_musicCaps.py +7 -22
spectrogram_musicCaps.py
CHANGED
|
@@ -40,7 +40,7 @@ class spectrogram_musicCaps(datasets.GeneratorBasedBuilder):
|
|
| 40 |
# データのサブセットはここで用意
|
| 41 |
BUILDER_CONFIGS = [
|
| 42 |
spectrogram_musicCapsConfig(
|
| 43 |
-
name="MusicCaps data
|
| 44 |
description="Datasets from MusicCaps by Mikan",
|
| 45 |
data_url="https://huggingface.co/datasets/mickylan2367/spectrogram_musicCaps/blob/main/data/data0_10.zip",
|
| 46 |
metadata_urls={
|
|
@@ -49,7 +49,7 @@ class spectrogram_musicCaps(datasets.GeneratorBasedBuilder):
|
|
| 49 |
},
|
| 50 |
),
|
| 51 |
spectrogram_musicCapsConfig(
|
| 52 |
-
name="MusicCpas data
|
| 53 |
description="Datasets second action by Mikan",
|
| 54 |
data_url="https://huggingface.co/datasets/mickylan2367/spectrogram_musicCaps/blob/main/data/data10_200.zip",
|
| 55 |
metadata_urls={
|
|
@@ -97,23 +97,8 @@ class spectrogram_musicCaps(datasets.GeneratorBasedBuilder):
|
|
| 97 |
# テキストファイルの方を入れる..
|
| 98 |
captions = f.readlines()
|
| 99 |
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
# こんなもん..?
|
| 107 |
-
# for idx, (file_path, file_obj) in enumerate(images):
|
| 108 |
-
# yield file_path,{
|
| 109 |
-
# "image":{"path":file_path, "bytes":file_obj.read()},
|
| 110 |
-
# "caption":captions[idx]
|
| 111 |
-
# }
|
| 112 |
-
# if file_path.startswith(_IMAGES_DIR): #
|
| 113 |
-
# if file_path[len(_IMAGES_DIR) : -len("*.png")] in files_to_keep:
|
| 114 |
-
# # label = file_path.split("/")[2]
|
| 115 |
-
# caption = captions[idx]
|
| 116 |
-
# yield file_path, {
|
| 117 |
-
# "image": {"path": file_path, "bytes": file_obj.read()},
|
| 118 |
-
# "caption": caption,
|
| 119 |
-
# }
|
|
|
|
| 40 |
# データのサブセットはここで用意
|
| 41 |
BUILDER_CONFIGS = [
|
| 42 |
spectrogram_musicCapsConfig(
|
| 43 |
+
name="MusicCaps data 0_10",
|
| 44 |
description="Datasets from MusicCaps by Mikan",
|
| 45 |
data_url="https://huggingface.co/datasets/mickylan2367/spectrogram_musicCaps/blob/main/data/data0_10.zip",
|
| 46 |
metadata_urls={
|
|
|
|
| 49 |
},
|
| 50 |
),
|
| 51 |
spectrogram_musicCapsConfig(
|
| 52 |
+
name="MusicCpas data 10_100",
|
| 53 |
description="Datasets second action by Mikan",
|
| 54 |
data_url="https://huggingface.co/datasets/mickylan2367/spectrogram_musicCaps/blob/main/data/data10_200.zip",
|
| 55 |
metadata_urls={
|
|
|
|
| 97 |
# テキストファイルの方を入れる..
|
| 98 |
captions = f.readlines()
|
| 99 |
|
| 100 |
+
for idx, (file_path, file_obj) in enumerate(zip(images)):
|
| 101 |
+
yield file_path,{
|
| 102 |
+
"image": file_obj.read(),
|
| 103 |
+
"caption":captions[idx]
|
| 104 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|