commit
9d67b757f0
@ -1,7 +1,10 @@
|
|||||||
from encoder.preprocess import preprocess_librispeech, preprocess_voxceleb1, preprocess_voxceleb2, preprocess_aidatatang_200zh
|
|
||||||
from utils.argutils import print_args
|
|
||||||
from pathlib import Path
|
|
||||||
import argparse
|
import argparse
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
from models.encoder.preprocess import (preprocess_aidatatang_200zh,
|
||||||
|
preprocess_librispeech, preprocess_voxceleb1,
|
||||||
|
preprocess_voxceleb2)
|
||||||
|
from utils.argutils import print_args
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
class MyFormatter(argparse.ArgumentDefaultsHelpFormatter, argparse.RawDescriptionHelpFormatter):
|
class MyFormatter(argparse.ArgumentDefaultsHelpFormatter, argparse.RawDescriptionHelpFormatter):
|
@ -1,5 +1,5 @@
|
|||||||
from utils.argutils import print_args
|
from utils.argutils import print_args
|
||||||
from encoder.train import train
|
from models.encoder.train import train
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import argparse
|
import argparse
|
||||||
|
|
@ -1,7 +1,7 @@
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
from ppg2mel.preprocess import preprocess_dataset
|
from models.ppg2mel.preprocess import preprocess_dataset
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import argparse
|
import argparse
|
||||||
|
|
@ -0,0 +1,66 @@
|
|||||||
|
import sys
|
||||||
|
import torch
|
||||||
|
import argparse
|
||||||
|
import numpy as np
|
||||||
|
from utils.hparams import HpsYaml
|
||||||
|
from models.ppg2mel.train.train_linglf02mel_seq2seq_oneshotvc import Solver
|
||||||
|
|
||||||
|
# For reproducibility, comment these may speed up training
|
||||||
|
torch.backends.cudnn.deterministic = True
|
||||||
|
torch.backends.cudnn.benchmark = False
|
||||||
|
|
||||||
|
def main():
|
||||||
|
# Arguments
|
||||||
|
parser = argparse.ArgumentParser(description=
|
||||||
|
'Training PPG2Mel VC model.')
|
||||||
|
parser.add_argument('--config', type=str,
|
||||||
|
help='Path to experiment config, e.g., config/vc.yaml')
|
||||||
|
parser.add_argument('--name', default=None, type=str, help='Name for logging.')
|
||||||
|
parser.add_argument('--logdir', default='log/', type=str,
|
||||||
|
help='Logging path.', required=False)
|
||||||
|
parser.add_argument('--ckpdir', default='ppg2mel/saved_models/', type=str,
|
||||||
|
help='Checkpoint path.', required=False)
|
||||||
|
parser.add_argument('--outdir', default='result/', type=str,
|
||||||
|
help='Decode output path.', required=False)
|
||||||
|
parser.add_argument('--load', default=None, type=str,
|
||||||
|
help='Load pre-trained model (for training only)', required=False)
|
||||||
|
parser.add_argument('--warm_start', action='store_true',
|
||||||
|
help='Load model weights only, ignore specified layers.')
|
||||||
|
parser.add_argument('--seed', default=0, type=int,
|
||||||
|
help='Random seed for reproducable results.', required=False)
|
||||||
|
parser.add_argument('--njobs', default=8, type=int,
|
||||||
|
help='Number of threads for dataloader/decoding.', required=False)
|
||||||
|
parser.add_argument('--cpu', action='store_true', help='Disable GPU training.')
|
||||||
|
parser.add_argument('--no-pin', action='store_true',
|
||||||
|
help='Disable pin-memory for dataloader')
|
||||||
|
parser.add_argument('--test', action='store_true', help='Test the model.')
|
||||||
|
parser.add_argument('--no-msg', action='store_true', help='Hide all messages.')
|
||||||
|
parser.add_argument('--finetune', action='store_true', help='Finetune model')
|
||||||
|
parser.add_argument('--oneshotvc', action='store_true', help='Oneshot VC model')
|
||||||
|
parser.add_argument('--bilstm', action='store_true', help='BiLSTM VC model')
|
||||||
|
parser.add_argument('--lsa', action='store_true', help='Use location-sensitive attention (LSA)')
|
||||||
|
|
||||||
|
###
|
||||||
|
paras = parser.parse_args()
|
||||||
|
setattr(paras, 'gpu', not paras.cpu)
|
||||||
|
setattr(paras, 'pin_memory', not paras.no_pin)
|
||||||
|
setattr(paras, 'verbose', not paras.no_msg)
|
||||||
|
# Make the config dict dot visitable
|
||||||
|
config = HpsYaml(paras.config)
|
||||||
|
|
||||||
|
np.random.seed(paras.seed)
|
||||||
|
torch.manual_seed(paras.seed)
|
||||||
|
if torch.cuda.is_available():
|
||||||
|
torch.cuda.manual_seed_all(paras.seed)
|
||||||
|
|
||||||
|
print(">>> OneShot VC training ...")
|
||||||
|
mode = "train"
|
||||||
|
solver = Solver(config, paras, mode)
|
||||||
|
solver.load_data()
|
||||||
|
solver.set_model()
|
||||||
|
solver.exec()
|
||||||
|
print(">>> Oneshot VC train finished!")
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
@ -1,5 +1,5 @@
|
|||||||
from synthesizer.synthesize import run_synthesis
|
from models.synthesizer.synthesize import run_synthesis
|
||||||
from synthesizer.hparams import hparams
|
from models.synthesizer.hparams import hparams
|
||||||
from utils.argutils import print_args
|
from utils.argutils import print_args
|
||||||
import argparse
|
import argparse
|
||||||
import os
|
import os
|
@ -1,7 +1,7 @@
|
|||||||
from utils.argutils import print_args
|
from utils.argutils import print_args
|
||||||
from vocoder.wavernn.train import train
|
from models.vocoder.wavernn.train import train
|
||||||
from vocoder.hifigan.train import train as train_hifigan
|
from models.vocoder.hifigan.train import train as train_hifigan
|
||||||
from vocoder.fregan.train import train as train_fregan
|
from models.vocoder.fregan.train import train as train_fregan
|
||||||
from utils.util import AttrDict
|
from utils.util import AttrDict
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import argparse
|
import argparse
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
@ -1,2 +0,0 @@
|
|||||||
from encoder.data_objects.speaker_verification_dataset import SpeakerVerificationDataset
|
|
||||||
from encoder.data_objects.speaker_verification_dataset import SpeakerVerificationDataLoader
|
|
Binary file not shown.
@ -1,5 +1,5 @@
|
|||||||
from scipy.ndimage.morphology import binary_dilation
|
from scipy.ndimage.morphology import binary_dilation
|
||||||
from encoder.params_data import *
|
from models.encoder.params_data import *
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Optional, Union
|
from typing import Optional, Union
|
||||||
from warnings import warn
|
from warnings import warn
|
@ -0,0 +1,2 @@
|
|||||||
|
from models.encoder.data_objects.speaker_verification_dataset import SpeakerVerificationDataset
|
||||||
|
from models.encoder.data_objects.speaker_verification_dataset import SpeakerVerificationDataLoader
|
@ -1,5 +1,5 @@
|
|||||||
from encoder.data_objects.random_cycler import RandomCycler
|
from models.encoder.data_objects.random_cycler import RandomCycler
|
||||||
from encoder.data_objects.utterance import Utterance
|
from models.encoder.data_objects.utterance import Utterance
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
# Contains the set of utterances of a single speaker
|
# Contains the set of utterances of a single speaker
|
@ -1,6 +1,6 @@
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
from typing import List
|
from typing import List
|
||||||
from encoder.data_objects.speaker import Speaker
|
from models.encoder.data_objects.speaker import Speaker
|
||||||
|
|
||||||
class SpeakerBatch:
|
class SpeakerBatch:
|
||||||
def __init__(self, speakers: List[Speaker], utterances_per_speaker: int, n_frames: int):
|
def __init__(self, speakers: List[Speaker], utterances_per_speaker: int, n_frames: int):
|
@ -1,7 +1,7 @@
|
|||||||
from encoder.data_objects.random_cycler import RandomCycler
|
from models.encoder.data_objects.random_cycler import RandomCycler
|
||||||
from encoder.data_objects.speaker_batch import SpeakerBatch
|
from models.encoder.data_objects.speaker_batch import SpeakerBatch
|
||||||
from encoder.data_objects.speaker import Speaker
|
from models.encoder.data_objects.speaker import Speaker
|
||||||
from encoder.params_data import partials_n_frames
|
from models.encoder.params_data import partials_n_frames
|
||||||
from torch.utils.data import Dataset, DataLoader
|
from torch.utils.data import Dataset, DataLoader
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
@ -1,8 +1,8 @@
|
|||||||
from encoder.params_data import *
|
from models.encoder.params_data import *
|
||||||
from encoder.model import SpeakerEncoder
|
from models.encoder.model import SpeakerEncoder
|
||||||
from encoder.audio import preprocess_wav # We want to expose this function from here
|
from models.encoder.audio import preprocess_wav # We want to expose this function from here
|
||||||
from matplotlib import cm
|
from matplotlib import cm
|
||||||
from encoder import audio
|
from models.encoder import audio
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import matplotlib.pyplot as plt
|
import matplotlib.pyplot as plt
|
||||||
import numpy as np
|
import numpy as np
|
@ -1,5 +1,5 @@
|
|||||||
from encoder.params_model import *
|
from models.encoder.params_model import *
|
||||||
from encoder.params_data import *
|
from models.encoder.params_data import *
|
||||||
from scipy.interpolate import interp1d
|
from scipy.interpolate import interp1d
|
||||||
from sklearn.metrics import roc_curve
|
from sklearn.metrics import roc_curve
|
||||||
from torch.nn.utils import clip_grad_norm_
|
from torch.nn.utils import clip_grad_norm_
|
@ -1,7 +1,7 @@
|
|||||||
from encoder.visualizations import Visualizations
|
from models.encoder.visualizations import Visualizations
|
||||||
from encoder.data_objects import SpeakerVerificationDataLoader, SpeakerVerificationDataset
|
from models.encoder.data_objects import SpeakerVerificationDataLoader, SpeakerVerificationDataset
|
||||||
from encoder.params_model import *
|
from models.encoder.params_model import *
|
||||||
from encoder.model import SpeakerEncoder
|
from models.encoder.model import SpeakerEncoder
|
||||||
from utils.profiler import Profiler
|
from utils.profiler import Profiler
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import torch
|
import torch
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue