代码拉取完成,页面将自动刷新
同步操作将从 东方佑/TTS-Clone-Chinese 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
from synthesizer.preprocess import preprocess_thchs30
from synthesizer.preprocess import preprocess_data_aishell
from synthesizer.preprocess import preprocess_aidatatang_200zh
from synthesizer.hparams import hparams
from utils.argutils import print_args
from pathlib import Path
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description="Preprocesses audio files from datasets, encodes them as mel spectrograms "
"and writes them to the disk. Audio files are also saved, to be used by the "
"vocoder for training.",
formatter_class=argparse.ArgumentDefaultsHelpFormatter
)
parser.add_argument("datasets_root", type=Path, help=\
"Path to the directory containing your LibriSpeech/TTS datasets.")
parser.add_argument("-o", "--out_dir", type=Path, default=argparse.SUPPRESS, help=\
"Path to the output directory that will contain the mel spectrograms, the audios and the "
"embeds. Defaults to <datasets_root>/SV2TTS/synthesizer/")
parser.add_argument("-n", "--n_processes", type=int, default=None, help=\
"Number of processes in parallel.")
parser.add_argument("-s", "--skip_existing", action="store_true", help=\
"Whether to overwrite existing files with the same name. Useful if the preprocessing was "
"interrupted.")
parser.add_argument("--hparams", type=str, default="", help=\
"Hyperparameter overrides as a comma-separated list of name-value pairs")
parser.add_argument("-d", "--dataset", type=str, default="", help=\
"what dataset to process.")
args = parser.parse_args()
# Process the arguments
if not hasattr(args, "out_dir"):
args.out_dir = args.datasets_root.joinpath("SV2TTS", "synthesizer")
# Create directories
assert args.datasets_root.exists()
args.out_dir.mkdir(exist_ok=True, parents=True)
# Preprocess the dataset
print_args(args, parser)
args.hparams = hparams.parse(args.hparams)
if not args.dataset:
raise ValueError("please input dataset, support aidatatang_200zh | data_aishell | thchs30")
if args.dataset == "thchs30":
preprocess_thchs30(**vars(args))
elif args.dataset == "aidatatang_200zh":
preprocess_aidatatang_200zh(**vars(args))
elif args.dataset == "data_aishell":
preprocess_data_aishell(**vars(args))
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。