From f2e2e87f184935b946ef749a4ceed612cc36fbdc Mon Sep 17 00:00:00 2001 From: wataru Date: Sun, 4 Jun 2023 17:56:12 +0900 Subject: [PATCH] nof0onnx not worked --- .gitignore | 3 +++ .../RVC/inferencer/OnnxRVCInferencerNono.py | 1 + server/voice_changer/RVC/pipeline/Pipeline.py | 10 +++++++--- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index a5cca763..2567e28f 100644 --- a/.gitignore +++ b/.gitignore @@ -50,6 +50,9 @@ server/samples.json server/samples_0003_t.json server/samples_0003_o.json +server/test_official_v1_v2.json +server/test_ddpn_v1_v2.json + start_trainer.sh # venv diff --git a/server/voice_changer/RVC/inferencer/OnnxRVCInferencerNono.py b/server/voice_changer/RVC/inferencer/OnnxRVCInferencerNono.py index 0a567b8e..f3579170 100644 --- a/server/voice_changer/RVC/inferencer/OnnxRVCInferencerNono.py +++ b/server/voice_changer/RVC/inferencer/OnnxRVCInferencerNono.py @@ -9,6 +9,7 @@ class OnnxRVCInferencerNono(OnnxRVCInferencer): def loadModel(self, file: str, gpu: int): super().loadModel(file, gpu) self.setProps(EnumInferenceTypes.onnxRVCNono, file, True, gpu) + return self def infer( self, diff --git a/server/voice_changer/RVC/pipeline/Pipeline.py b/server/voice_changer/RVC/pipeline/Pipeline.py index b916b27e..46ed3ddd 100644 --- a/server/voice_changer/RVC/pipeline/Pipeline.py +++ b/server/voice_changer/RVC/pipeline/Pipeline.py @@ -42,6 +42,7 @@ class Pipeline(object): self.embedder = embedder self.inferencer = inferencer self.pitchExtractor = pitchExtractor + print("GENERATE INFERENCER:::", self.inferencer) self.index = index self.big_npy = ( @@ -166,7 +167,9 @@ class Pipeline(object): npy = np.sum(self.big_npy[ix] * np.expand_dims(weight, axis=2), axis=1) # recover silient font - npy = np.concatenate([np.zeros([npyOffset, npy.shape[1]]).astype("float32"), npy]) + npy = np.concatenate( + [np.zeros([npyOffset, npy.shape[1]]).astype("float32"), npy] + ) if self.isHalf is True: npy = npy.astype("float16") @@ -204,8 +207,9 @@ class Pipeline(object): npyOffset = math.floor(silence_front * 16000) // 360 feats = feats[:, npyOffset * 2 :, :] feats_len = feats.shape[1] - pitch = pitch[:, -feats_len:] - pitchf = pitchf[:, -feats_len:] + if pitch is not None and pitchf is not None: + pitch = pitch[:, -feats_len:] + pitchf = pitchf[:, -feats_len:] p_len = torch.tensor([feats_len], device=self.device).long() # 推論実行