upd: added pre-training model setup
Browse files- rwth_phoenix_weather_2014.py +15 -3
rwth_phoenix_weather_2014.py
CHANGED
@@ -69,6 +69,12 @@ class RWTHPhoenixWeather2014(datasets.GeneratorBasedBuilder):
|
|
69 |
main_data_folder="phoenix-2014-signerindependent-SI5",
|
70 |
corpus_file_suffix=".SI5.corpus.csv"
|
71 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
]
|
73 |
|
74 |
def _info(self):
|
@@ -115,6 +121,10 @@ class RWTHPhoenixWeather2014(datasets.GeneratorBasedBuilder):
|
|
115 |
|
116 |
split_ids[split] = df.id
|
117 |
|
|
|
|
|
|
|
|
|
118 |
frame_archive_urls = dl_manager.download([
|
119 |
f"{base_url}/features/fullFrame-210x260px/{dataDirMapper[split]}/{id}.tar"
|
120 |
for id in df.id
|
@@ -145,9 +155,11 @@ class RWTHPhoenixWeather2014(datasets.GeneratorBasedBuilder):
|
|
145 |
for id, frames, tokens in zip(split_ids, split_frames, split_tokens):
|
146 |
frames_as_list = [
|
147 |
{"path": p, "bytes": im.read()} for p, im in frames
|
148 |
-
]
|
149 |
|
150 |
-
|
151 |
"tokens": tokens,
|
152 |
-
"frames": frames_as_list,
|
153 |
}
|
|
|
|
|
|
69 |
main_data_folder="phoenix-2014-signerindependent-SI5",
|
70 |
corpus_file_suffix=".SI5.corpus.csv"
|
71 |
),
|
72 |
+
RWTHPhoenixWeather2014Config(
|
73 |
+
name="pre-training",
|
74 |
+
description="",
|
75 |
+
main_data_folder="phoenix-2014-multisigner",
|
76 |
+
corpus_file_suffix=".corpus.csv"
|
77 |
+
),
|
78 |
]
|
79 |
|
80 |
def _info(self):
|
|
|
121 |
|
122 |
split_ids[split] = df.id
|
123 |
|
124 |
+
if self.config.name == 'pre-training':
|
125 |
+
split_frames[split] = None
|
126 |
+
continue
|
127 |
+
|
128 |
frame_archive_urls = dl_manager.download([
|
129 |
f"{base_url}/features/fullFrame-210x260px/{dataDirMapper[split]}/{id}.tar"
|
130 |
for id in df.id
|
|
|
155 |
for id, frames, tokens in zip(split_ids, split_frames, split_tokens):
|
156 |
frames_as_list = [
|
157 |
{"path": p, "bytes": im.read()} for p, im in frames
|
158 |
+
] if frames is not None else None
|
159 |
|
160 |
+
result = {
|
161 |
"tokens": tokens,
|
162 |
+
"frames": frames_as_list if frames_as_list is not None else [],
|
163 |
}
|
164 |
+
|
165 |
+
yield id,
|