mirror of
https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI.git
synced 2025-05-06 20:01:37 +08:00
add fcpe to pipeline (#1934)
This commit is contained in:
parent
e5b43249a0
commit
82bd4b1dd1
@ -150,6 +150,7 @@ class Pipeline(object):
|
|||||||
"%s/rmvpe.pt" % os.environ["rmvpe_root"],
|
"%s/rmvpe.pt" % os.environ["rmvpe_root"],
|
||||||
is_half=self.is_half,
|
is_half=self.is_half,
|
||||||
device=self.device,
|
device=self.device,
|
||||||
|
# use_jit=self.config.use_jit,
|
||||||
)
|
)
|
||||||
f0 = self.model_rmvpe.infer_from_audio(x, thred=0.03)
|
f0 = self.model_rmvpe.infer_from_audio(x, thred=0.03)
|
||||||
|
|
||||||
@ -157,6 +158,18 @@ class Pipeline(object):
|
|||||||
del self.model_rmvpe.model
|
del self.model_rmvpe.model
|
||||||
del self.model_rmvpe
|
del self.model_rmvpe
|
||||||
logger.info("Cleaning ortruntime memory")
|
logger.info("Cleaning ortruntime memory")
|
||||||
|
elif f0_method == "fcpe":
|
||||||
|
if not hasattr(self, "model_fcpe"):
|
||||||
|
from torchfcpe import spawn_bundled_infer_model
|
||||||
|
|
||||||
|
logger.info("Loading fcpe model")
|
||||||
|
self.model_fcpe = spawn_bundled_infer_model(self.device)
|
||||||
|
f0 = self.model_fcpe.infer(
|
||||||
|
torch.from_numpy(x).to(self.device).unsqueeze(0).float(),
|
||||||
|
sr=16000,
|
||||||
|
decoder_mode="local_argmax",
|
||||||
|
threshold=0.006,
|
||||||
|
).squeeze().cpu().numpy()
|
||||||
|
|
||||||
f0 *= pow(2, f0_up_key / 12)
|
f0 *= pow(2, f0_up_key / 12)
|
||||||
# with open("test.txt","w")as f:f.write("\n".join([str(i)for i in f0.tolist()]))
|
# with open("test.txt","w")as f:f.write("\n".join([str(i)for i in f0.tolist()]))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user