From eeee32f3e3ec7db7cb56f91daca1a925669ed882 Mon Sep 17 00:00:00 2001 From: babysor00 Date: Sat, 26 Feb 2022 17:26:27 +0800 Subject: [PATCH] Fix length issue --- pre4ppg.py | 2 +- utils/data_load.py | 6 +++--- utils/f0_utils.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pre4ppg.py b/pre4ppg.py index 408cb05..fcfa0fa 100644 --- a/pre4ppg.py +++ b/pre4ppg.py @@ -23,7 +23,7 @@ if __name__ == "__main__": 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 /PPGVC/ppg2mel/") - parser.add_argument("-n", "--n_processes", type=int, default=16, help=\ + parser.add_argument("-n", "--n_processes", type=int, default=8, 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 " diff --git a/utils/data_load.py b/utils/data_load.py index 90212b5..37723cf 100644 --- a/utils/data_load.py +++ b/utils/data_load.py @@ -83,9 +83,9 @@ class OneshotVcDataset(torch.utils.data.Dataset): n_fft=1024, num_mels=80, sampling_rate=SAMPLE_RATE, - hop_size=200, - win_size=800, - fmin=0, + hop_size=160, + win_size=1024, + fmin=80, fmax=8000, ) return melspec.squeeze(0).numpy().T diff --git a/utils/f0_utils.py b/utils/f0_utils.py index e358ce2..6bc25a8 100644 --- a/utils/f0_utils.py +++ b/utils/f0_utils.py @@ -15,7 +15,7 @@ def compute_f0(wav, sr=16000, frame_period=10.0): """Compute f0 from wav using pyworld harvest algorithm.""" wav = wav.astype(np.float64) f0, _ = pyworld.harvest( - wav, sr, frame_period=frame_period, f0_floor=20.0, f0_ceil=600.0) + wav, sr, frame_period=frame_period, f0_floor=80.0, f0_ceil=600.0) return f0.astype(np.float32) def f02lf0(f0):