mirror of
https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI.git
synced 2025-05-06 20:01:37 +08:00
fix(vc.hash): embed rmvpe result
This commit is contained in:
parent
de848286b2
commit
ee72eca6a5
@ -102,7 +102,7 @@ def model_hash(config, tgt_sr, net_g, if_f0, version):
|
|||||||
"rmvpe",
|
"rmvpe",
|
||||||
"",
|
"",
|
||||||
0,
|
0,
|
||||||
if_f0,
|
2 if if_f0 else 0,
|
||||||
3,
|
3,
|
||||||
tgt_sr,
|
tgt_sr,
|
||||||
16000,
|
16000,
|
||||||
|
BIN
infer/modules/vc/lgdsng_f0.npz
Normal file
BIN
infer/modules/vc/lgdsng_f0.npz
Normal file
Binary file not shown.
@ -16,6 +16,7 @@ import pyworld
|
|||||||
import torch
|
import torch
|
||||||
import torch.nn.functional as F
|
import torch.nn.functional as F
|
||||||
import torchcrepe
|
import torchcrepe
|
||||||
|
import pathlib
|
||||||
from scipy import signal
|
from scipy import signal
|
||||||
|
|
||||||
now_dir = os.getcwd()
|
now_dir = os.getcwd()
|
||||||
@ -374,6 +375,7 @@ class Pipeline(object):
|
|||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
sid = torch.tensor(sid, device=self.device).unsqueeze(0).long()
|
sid = torch.tensor(sid, device=self.device).unsqueeze(0).long()
|
||||||
pitch, pitchf = None, None
|
pitch, pitchf = None, None
|
||||||
|
if if_f0:
|
||||||
if if_f0 == 1:
|
if if_f0 == 1:
|
||||||
pitch, pitchf = self.get_f0(
|
pitch, pitchf = self.get_f0(
|
||||||
audio_pad,
|
audio_pad,
|
||||||
@ -383,6 +385,12 @@ class Pipeline(object):
|
|||||||
filter_radius,
|
filter_radius,
|
||||||
inp_f0,
|
inp_f0,
|
||||||
)
|
)
|
||||||
|
"""
|
||||||
|
np.savez_compressed(pathlib.Path(__file__).parent / "lgdsng_f0.npz", pitch=pitch, pitchf=pitchf)
|
||||||
|
"""
|
||||||
|
elif if_f0 == 2:
|
||||||
|
pitchz = np.load(pathlib.Path(__file__).parent / "lgdsng_f0.npz")
|
||||||
|
pitch, pitchf = pitchz["pitch"], pitchz["pitchf"]
|
||||||
pitch = pitch[:p_len]
|
pitch = pitch[:p_len]
|
||||||
pitchf = pitchf[:p_len]
|
pitchf = pitchf[:p_len]
|
||||||
if "mps" not in str(self.device) or "xpu" not in str(self.device):
|
if "mps" not in str(self.device) or "xpu" not in str(self.device):
|
||||||
@ -393,7 +401,7 @@ class Pipeline(object):
|
|||||||
times[1] += t2 - t1
|
times[1] += t2 - t1
|
||||||
for t in opt_ts:
|
for t in opt_ts:
|
||||||
t = t // self.window * self.window
|
t = t // self.window * self.window
|
||||||
if if_f0 == 1:
|
if if_f0:
|
||||||
audio_opt.append(
|
audio_opt.append(
|
||||||
self.vc(
|
self.vc(
|
||||||
model,
|
model,
|
||||||
@ -428,7 +436,7 @@ class Pipeline(object):
|
|||||||
)[self.t_pad_tgt : -self.t_pad_tgt]
|
)[self.t_pad_tgt : -self.t_pad_tgt]
|
||||||
)
|
)
|
||||||
s = t
|
s = t
|
||||||
if if_f0 == 1:
|
if if_f0:
|
||||||
audio_opt.append(
|
audio_opt.append(
|
||||||
self.vc(
|
self.vc(
|
||||||
model,
|
model,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user