Update fsdkaggle2019-script.py
Browse files- fsdkaggle2019-script.py +3 -2
fsdkaggle2019-script.py
CHANGED
|
@@ -105,7 +105,8 @@ class FSDKaggle2019(datasets.GeneratorBasedBuilder):
|
|
| 105 |
)
|
| 106 |
_input_file = os.path.join(HF_DATASETS_CACHE, 'confit___fsdkaggle2019-script/noisy', VERSION, 'FSDKaggle2019.audio_train_noisy.zip')
|
| 107 |
_output_file = os.path.join(HF_DATASETS_CACHE, 'confit___fsdkaggle2019-script/noisy', VERSION, 'FSDKaggle2019.audio_train_noisy.combine.zip')
|
| 108 |
-
os.
|
|
|
|
| 109 |
train_archive_path = dl_manager.extract(_output_file)
|
| 110 |
test_archive_path = dl_manager.download_and_extract(_TEST_URL)
|
| 111 |
metadata_archive_path = dl_manager.download_and_extract(_METADATA_URL)
|
|
@@ -133,7 +134,7 @@ class FSDKaggle2019(datasets.GeneratorBasedBuilder):
|
|
| 133 |
fileid = Path(audio_path).name
|
| 134 |
ids = metadata_df.query(f'fname=="{fileid}"')['labels'].values.tolist()
|
| 135 |
ids = str(ids[0]).split(',')
|
| 136 |
-
|
| 137 |
return ids
|
| 138 |
|
| 139 |
for guid, audio_path in enumerate(audio_paths):
|
|
|
|
| 105 |
)
|
| 106 |
_input_file = os.path.join(HF_DATASETS_CACHE, 'confit___fsdkaggle2019-script/noisy', VERSION, 'FSDKaggle2019.audio_train_noisy.zip')
|
| 107 |
_output_file = os.path.join(HF_DATASETS_CACHE, 'confit___fsdkaggle2019-script/noisy', VERSION, 'FSDKaggle2019.audio_train_noisy.combine.zip')
|
| 108 |
+
if not os.path.exists(_output_file):
|
| 109 |
+
os.system(f"zip -q -F {_input_file} --out {_output_file}")
|
| 110 |
train_archive_path = dl_manager.extract(_output_file)
|
| 111 |
test_archive_path = dl_manager.download_and_extract(_TEST_URL)
|
| 112 |
metadata_archive_path = dl_manager.download_and_extract(_METADATA_URL)
|
|
|
|
| 134 |
fileid = Path(audio_path).name
|
| 135 |
ids = metadata_df.query(f'fname=="{fileid}"')['labels'].values.tolist()
|
| 136 |
ids = str(ids[0]).split(',')
|
| 137 |
+
assert False, f"{ids} {audio_path}"
|
| 138 |
return ids
|
| 139 |
|
| 140 |
for guid, audio_path in enumerate(audio_paths):
|