Skip to content

Commit 107c90c

Browse files
committed
download libritts test
1 parent 8653fe3 commit 107c90c

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

wavtokenizer/prepare_libritts.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,15 @@ def main():
4141
# Define download URLs
4242
train_url = "http://www.openslr.org/resources/60/train-clean-100.tar.gz"
4343
val_url = "http://www.openslr.org/resources/60/dev-clean.tar.gz"
44+
test_url = "http://www.openslr.org/resources/60/test-clean.tar.gz"
4445

4546
# Define target directories and extraction subdirectories
4647
train_dir = "./data/train"
4748
val_dir = "./data/infer"
49+
test_dir = "./data/infer"
4850
train_extraction_subdir = os.path.join(train_dir, "LibriTTS", "train-clean-100")
4951
val_extraction_subdir = os.path.join(val_dir, "LibriTTS", "dev-clean")
52+
test_extraction_subdir = os.path.join(test_dir, "LibriTTS", "test-clean")
5053

5154
# Skip processing if the train or infer directory already exists
5255
if os.path.exists(train_extraction_subdir) and os.listdir(train_extraction_subdir):
@@ -63,6 +66,13 @@ def main():
6366
download_and_extract(val_url, val_dir)
6467
generate_filelist(val_extraction_subdir, os.path.join(val_dir, "libritts_val"))
6568

69+
if os.path.exists(test_extraction_subdir) and os.listdir(test_extraction_subdir):
70+
print(f"{test_extraction_subdir} already exists, skipping test data preparation.")
71+
else:
72+
print(f"Checking test data in {test_extraction_subdir}...")
73+
download_and_extract(test_url, test_dir)
74+
generate_filelist(test_extraction_subdir, os.path.join(test_dir, "libritts_testclean"))
75+
6676
print("Dataset preparation complete.")
6777

6878
if __name__ == "__main__":
@@ -84,10 +94,7 @@ def main():
8494
│ └── infer/
8595
│ ├── LibriTTS/
8696
│ │ └── dev-clean/
87-
│ │ ├── <speaker_id>/
88-
│ │ │ ├── <chapter_id>/
89-
│ │ │ │ ├── <audio_files>.wav
90-
│ │ │ │ └── ...
91-
│ │ └── ...
92-
│ └── libritts_val # File list generated here
97+
│ | └── test-clean/
98+
│ └── libritts_val
99+
| └── libritts_testclean
93100
"""

0 commit comments

Comments
 (0)