Refactor folder structure

This commit is contained in:
babysor00 2021-09-12 17:33:39 +08:00
parent 78fcfc4651
commit 32b9755cbe
15 changed files with 17 additions and 27 deletions

View File

@ -1,8 +1,8 @@
from toolbox.ui import UI
from encoder import inference as encoder
from synthesizer.inference import Synthesizer
from vocoder import inference as rnn_vocoder
from hifigan import inference as gan_vocoder
from vocoder.wavernn import inference as rnn_vocoder
from vocoder.hifigan import inference as gan_vocoder
from pathlib import Path
from time import perf_counter as timer
from toolbox.utterance import Utterance
@ -50,13 +50,6 @@ MAX_WAVES = 15
class Toolbox:
def __init__(self, datasets_root, enc_models_dir, syn_models_dir, voc_models_dir, seed, no_mp3_support):
if not no_mp3_support:
try:
librosa.load("samples/6829_00000.mp3")
except NoBackendError:
print("Librosa will be unable to open mp3 files if additional software is not installed.\n"
"Please install ffmpeg or add the '--no_mp3_support' option to proceed without support for mp3 files.")
exit(-1)
self.no_mp3_support = no_mp3_support
sys.excepthook = self.excepthook
self.datasets_root = datasets_root

View File

@ -1,15 +1,12 @@
from __future__ import absolute_import, division, print_function, unicode_literals
import glob
import os
import argparse
import json
import torch
import numpy as np
from scipy.io.wavfile import write
from hifigan.env import AttrDict
from hifigan.meldataset import mel_spectrogram, MAX_WAV_VALUE, load_wav
from hifigan.models import Generator
from vocoder.hifigan.env import AttrDict
from vocoder.hifigan.meldataset import mel_spectrogram, MAX_WAV_VALUE, load_wav
from vocoder.hifigan.models import Generator
import soundfile as sf
@ -31,7 +28,7 @@ def load_model(weights_fpath, verbose=True):
if verbose:
print("Building hifigan")
with open("./hifigan/config_16k_.json") as f:
with open("./vocoder/hifigan/config_16k_.json") as f:
data = f.read()
json_config = json.loads(data)
h = AttrDict(json_config)

View File

@ -3,7 +3,7 @@ import torch.nn.functional as F
import torch.nn as nn
from torch.nn import Conv1d, ConvTranspose1d, AvgPool1d, Conv2d
from torch.nn.utils import weight_norm, remove_weight_norm, spectral_norm
from hifigan.utils import init_weights, get_padding
from vocoder.hifigan.utils import init_weights, get_padding
LRELU_SLOPE = 0.1

View File

@ -1,7 +1,7 @@
import math
import numpy as np
import librosa
import vocoder.hparams as hp
import vocoder.wavernn.hparams as hp
from scipy.signal import lfilter
import soundfile as sf

View File

@ -1,5 +1,5 @@
from vocoder.models.fatchord_version import WaveRNN
from vocoder.audio import *
from vocoder.wavernn.models.fatchord_version import WaveRNN
from vocoder.wavernn.audio import *
def gen_testset(model: WaveRNN, test_set, samples, batched, target, overlap, save_path):

View File

@ -1,5 +1,5 @@
from vocoder.models.fatchord_version import WaveRNN
from vocoder import hparams as hp
from vocoder.wavernn.models.fatchord_version import WaveRNN
from vocoder.wavernn import hparams as hp
import torch

View File

@ -3,7 +3,7 @@ import torch.nn as nn
import torch.nn.functional as F
from vocoder.distribution import sample_from_discretized_mix_logistic
from vocoder.display import *
from vocoder.audio import *
from vocoder.wavernn.audio import *
class ResBlock(nn.Module):

View File

@ -1,13 +1,13 @@
from vocoder.models.fatchord_version import WaveRNN
from vocoder.wavernn.models.fatchord_version import WaveRNN
from vocoder.vocoder_dataset import VocoderDataset, collate_vocoder
from vocoder.distribution import discretized_mix_logistic_loss
from vocoder.display import stream, simple_table
from vocoder.gen_wavernn import gen_testset
from vocoder.wavernn.gen_wavernn import gen_testset
from torch.utils.data import DataLoader
from pathlib import Path
from torch import optim
import torch.nn.functional as F
import vocoder.hparams as hp
import vocoder.wavernn.hparams as hp
import numpy as np
import time
import torch

View File

@ -1,5 +1,5 @@
from utils.argutils import print_args
from vocoder.train import train
from vocoder.wavernn.train import train
from pathlib import Path
import argparse