-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathprepare_align.py
30 lines (24 loc) · 1.02 KB
/
prepare_align.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import os
import argparse
import yaml
from preprocessor import libritts, vctk
def main(config):
if "LibriTTS" in config["dataset"]:
corpus_path = config["path"]["corpus_path"]
raw_path = config["path"]["raw_path"]
for dmode, dset in config["subsets"].items():
config["path"]["corpus_path"] = os.path.join(corpus_path, dset)
config["path"]["raw_path"] = os.path.join(raw_path, dset)
libritts.prepare_align(config)
if "VCTK" in config["dataset"]:
corpus_path = config["path"]["corpus_path"]
raw_path = config["path"]["raw_path"]
for dmode, dset in config["subsets"].items():
config["path"]["raw_path"] = os.path.join(raw_path, dset)
vctk.prepare_align(config)
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("config", type=str, help="path to preprocess.yaml")
args = parser.parse_args()
config = yaml.load(open(args.config, "r"), Loader=yaml.FullLoader)
main(config)