mirror of
https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI.git
synced 2025-12-16 19:57:58 +01:00
format
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
# This code references https://huggingface.co/JosephusCheung/ASimilarityCalculatior/blob/main/qwerty.py
|
||||
# Fill in the path of the model to be queried and the root directory of the reference models, and this script will return the similarity between the model to be queried and all reference models.
|
||||
import sys, os
|
||||
import os
|
||||
import sys
|
||||
|
||||
import torch
|
||||
import torch.nn as nn
|
||||
import torch.nn.functional as F
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from lib.infer_pack.models_onnx import SynthesizerTrnMsNSFsidM
|
||||
import torch
|
||||
from lib.infer_pack.models_onnx import SynthesizerTrnMsNSFsidM
|
||||
|
||||
if __name__ == "__main__":
|
||||
MoeVS = True # 模型是否为MoeVoiceStudio(原MoeSS)使用
|
||||
|
||||
@@ -2,34 +2,36 @@
|
||||
|
||||
对源特征进行检索
|
||||
"""
|
||||
import torch, pdb, os, parselmouth
|
||||
import os
|
||||
import pdb
|
||||
|
||||
import parselmouth
|
||||
import torch
|
||||
|
||||
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
|
||||
# import torchcrepe
|
||||
from time import time as ttime
|
||||
|
||||
# import pyworld
|
||||
import librosa
|
||||
import numpy as np
|
||||
import scipy.signal as signal
|
||||
import soundfile as sf
|
||||
import torch.nn.functional as F
|
||||
from fairseq import checkpoint_utils
|
||||
|
||||
# from models import SynthesizerTrn256#hifigan_nonsf
|
||||
# from lib.infer_pack.models import SynthesizerTrn256NSF as SynthesizerTrn256#hifigan_nsf
|
||||
from lib.infer_pack.models import (
|
||||
SynthesizerTrnMs256NSFsid as SynthesizerTrn256,
|
||||
) # hifigan_nsf
|
||||
from scipy.io import wavfile
|
||||
|
||||
# from lib.infer_pack.models import SynthesizerTrnMs256NSFsid_sim as SynthesizerTrn256#hifigan_nsf
|
||||
# from models import SynthesizerTrn256NSFsim as SynthesizerTrn256#hifigan_nsf
|
||||
# from models import SynthesizerTrn256NSFsimFlow as SynthesizerTrn256#hifigan_nsf
|
||||
|
||||
|
||||
from scipy.io import wavfile
|
||||
from fairseq import checkpoint_utils
|
||||
|
||||
# import pyworld
|
||||
import librosa
|
||||
import torch.nn.functional as F
|
||||
import scipy.signal as signal
|
||||
|
||||
# import torchcrepe
|
||||
from time import time as ttime
|
||||
|
||||
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
||||
model_path = r"E:\codes\py39\vits_vc_gpu_train\hubert_base.pt" #
|
||||
print("load model(s) from {}".format(model_path))
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
"""
|
||||
格式:直接cid为自带的index位;aid放不下了,通过字典来查,反正就5w个
|
||||
"""
|
||||
import faiss, numpy as np, os
|
||||
from sklearn.cluster import MiniBatchKMeans
|
||||
import os
|
||||
import traceback
|
||||
from multiprocessing import cpu_count
|
||||
|
||||
import faiss
|
||||
import numpy as np
|
||||
from sklearn.cluster import MiniBatchKMeans
|
||||
|
||||
# ###########如果是原始特征要先写save
|
||||
n_cpu = 0
|
||||
if n_cpu == 0:
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
"""
|
||||
格式:直接cid为自带的index位;aid放不下了,通过字典来查,反正就5w个
|
||||
"""
|
||||
import faiss, numpy as np, os
|
||||
import os
|
||||
|
||||
import faiss
|
||||
import numpy as np
|
||||
|
||||
# ###########如果是原始特征要先写save
|
||||
inp_root = r"E:\codes\py39\dataset\mi\2-co256"
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import torch, pdb
|
||||
import pdb
|
||||
|
||||
import torch
|
||||
|
||||
# a=torch.load(r"E:\codes\py39\vits_vc_gpu_train\logs\ft-mi-suc\G_1000.pth")["model"]#sim_nsf#
|
||||
# a=torch.load(r"E:\codes\py39\vits_vc_gpu_train\logs\ft-mi-freeze-vocoder-flow-enc_q\G_1000.pth")["model"]#sim_nsf#
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import soundfile
|
||||
|
||||
from ..lib.infer_pack.onnx_inference import OnnxRVC
|
||||
|
||||
hop_size = 512
|
||||
|
||||
Reference in New Issue
Block a user