Update BirdSet.py
Browse files- BirdSet.py +13 -2
BirdSet.py
CHANGED
@@ -305,6 +305,15 @@ class BirdSet(datasets.GeneratorBasedBuilder):
|
|
305 |
"SSW": 36,
|
306 |
"SNE": 5}
|
307 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
308 |
if self.config.name.endswith("_xc"):
|
309 |
ds_name = ds_name[:-3]
|
310 |
dl_dir = dl_manager.download({
|
@@ -316,6 +325,7 @@ class BirdSet(datasets.GeneratorBasedBuilder):
|
|
316 |
ds_name = ds_name[:-6]
|
317 |
dl_dir = dl_manager.download({
|
318 |
"test": [os.path.join(self.config.data_dir, f"{ds_name}_test_shard_{n:04d}.tar.gz") for n in range(1, test_files[ds_name] + 1)],
|
|
|
319 |
"metadata": os.path.join(self.config.data_dir, f"{ds_name}_metadata_test.parquet"),
|
320 |
"metadata_5s": os.path.join(self.config.data_dir, f"{ds_name}_metadata_test_5s.parquet"),
|
321 |
})
|
@@ -330,6 +340,7 @@ class BirdSet(datasets.GeneratorBasedBuilder):
|
|
330 |
dl_dir = dl_manager.download({
|
331 |
"train": [os.path.join(self.config.data_dir, f"{ds_name}_train_shard_{n:04d}.tar.gz") for n in range(1, train_files[ds_name] + 1)],
|
332 |
"test": [os.path.join(self.config.data_dir, f"{ds_name}_test_shard_{n:04d}.tar.gz") for n in range(1, test_files[ds_name] + 1)],
|
|
|
333 |
"meta_train": os.path.join(self.config.data_dir, f"{ds_name}_metadata_train.parquet"),
|
334 |
"meta_test": os.path.join(self.config.data_dir, f"{ds_name}_metadata_test.parquet"),
|
335 |
"meta_test_5s": os.path.join(self.config.data_dir, f"{ds_name}_metadata_test_5s.parquet"),
|
@@ -356,7 +367,7 @@ class BirdSet(datasets.GeneratorBasedBuilder):
|
|
356 |
name=datasets.Split.TEST,
|
357 |
gen_kwargs={
|
358 |
"audio_archive_iterators": [dl_manager.iter_archive(archive_path) for archive_path in dl_dir["test"]],
|
359 |
-
"local_audio_archives_paths": local_audio_archives_paths["
|
360 |
"metapath": dl_dir["metadata"],
|
361 |
"split": datasets.Split.TEST,
|
362 |
},
|
@@ -395,7 +406,7 @@ class BirdSet(datasets.GeneratorBasedBuilder):
|
|
395 |
name="test_5s",
|
396 |
gen_kwargs={
|
397 |
"audio_archive_iterators": [dl_manager.iter_archive(archive_path) for archive_path in dl_dir["test"]],
|
398 |
-
"local_audio_archives_paths": local_audio_archives_paths["
|
399 |
"metapath": dl_dir["meta_test_5s"],
|
400 |
"split": "test_multilabel"
|
401 |
},
|
|
|
305 |
"SSW": 36,
|
306 |
"SNE": 5}
|
307 |
|
308 |
+
test5s_files = {"PER": 1,
|
309 |
+
"NES": 1,
|
310 |
+
"UHH": 1,
|
311 |
+
"HSN": 1,
|
312 |
+
"NBP": 1,
|
313 |
+
"POW": 1,
|
314 |
+
"SSW": 4,
|
315 |
+
"SNE": 1}
|
316 |
+
|
317 |
if self.config.name.endswith("_xc"):
|
318 |
ds_name = ds_name[:-3]
|
319 |
dl_dir = dl_manager.download({
|
|
|
325 |
ds_name = ds_name[:-6]
|
326 |
dl_dir = dl_manager.download({
|
327 |
"test": [os.path.join(self.config.data_dir, f"{ds_name}_test_shard_{n:04d}.tar.gz") for n in range(1, test_files[ds_name] + 1)],
|
328 |
+
"test_5s": [os.path.join(self.config.data_dir, f"{ds_name}_test5s_shard_{n:04d}.tar.gz") for n in range(1, test5s_files[ds_name] + 1)],
|
329 |
"metadata": os.path.join(self.config.data_dir, f"{ds_name}_metadata_test.parquet"),
|
330 |
"metadata_5s": os.path.join(self.config.data_dir, f"{ds_name}_metadata_test_5s.parquet"),
|
331 |
})
|
|
|
340 |
dl_dir = dl_manager.download({
|
341 |
"train": [os.path.join(self.config.data_dir, f"{ds_name}_train_shard_{n:04d}.tar.gz") for n in range(1, train_files[ds_name] + 1)],
|
342 |
"test": [os.path.join(self.config.data_dir, f"{ds_name}_test_shard_{n:04d}.tar.gz") for n in range(1, test_files[ds_name] + 1)],
|
343 |
+
"test_5s": [os.path.join(self.config.data_dir, f"{ds_name}_test5s_shard_{n:04d}.tar.gz") for n in range(1, test5s_files[ds_name] + 1)],
|
344 |
"meta_train": os.path.join(self.config.data_dir, f"{ds_name}_metadata_train.parquet"),
|
345 |
"meta_test": os.path.join(self.config.data_dir, f"{ds_name}_metadata_test.parquet"),
|
346 |
"meta_test_5s": os.path.join(self.config.data_dir, f"{ds_name}_metadata_test_5s.parquet"),
|
|
|
367 |
name=datasets.Split.TEST,
|
368 |
gen_kwargs={
|
369 |
"audio_archive_iterators": [dl_manager.iter_archive(archive_path) for archive_path in dl_dir["test"]],
|
370 |
+
"local_audio_archives_paths": local_audio_archives_paths["test_5s"] if local_audio_archives_paths else None,
|
371 |
"metapath": dl_dir["metadata"],
|
372 |
"split": datasets.Split.TEST,
|
373 |
},
|
|
|
406 |
name="test_5s",
|
407 |
gen_kwargs={
|
408 |
"audio_archive_iterators": [dl_manager.iter_archive(archive_path) for archive_path in dl_dir["test"]],
|
409 |
+
"local_audio_archives_paths": local_audio_archives_paths["test_5s"] if local_audio_archives_paths else None,
|
410 |
"metapath": dl_dir["meta_test_5s"],
|
411 |
"split": "test_multilabel"
|
412 |
},
|