Upload 4 files
Browse files- infer/modules/vc/pipeline.py +4 -11
infer/modules/vc/pipeline.py
CHANGED
@@ -118,16 +118,6 @@ class Pipeline(object):
|
|
118 |
f0 = cache_harvest_f0(input_audio_path, self.sr, f0_max, f0_min, 10)
|
119 |
if filter_radius > 2:
|
120 |
f0 = signal.medfilt(f0, 3)
|
121 |
-
elif f0_method == "dio":
|
122 |
-
f0, t = pyworld.dio(
|
123 |
-
x.astype(np.double),
|
124 |
-
fs=self.sr,
|
125 |
-
f0_ceil=f0_max,
|
126 |
-
f0_floor=f0_min,
|
127 |
-
frame_period=10,
|
128 |
-
)
|
129 |
-
f0 = pyworld.stonemask(x.astype(np.double), f0, t, self.sr)
|
130 |
-
f0 = signal.medfilt(f0, 3)
|
131 |
elif f0_method == "crepe":
|
132 |
model = "full"
|
133 |
# Pick a batch size that doesn't cause memory errors on your gpu
|
@@ -145,7 +135,10 @@ class Pipeline(object):
|
|
145 |
device=self.device,
|
146 |
return_periodicity=True,
|
147 |
)
|
148 |
-
|
|
|
|
|
|
|
149 |
elif f0_method == "rmvpe":
|
150 |
if not hasattr(self, "model_rmvpe"):
|
151 |
from infer.lib.rmvpe import RMVPE
|
|
|
118 |
f0 = cache_harvest_f0(input_audio_path, self.sr, f0_max, f0_min, 10)
|
119 |
if filter_radius > 2:
|
120 |
f0 = signal.medfilt(f0, 3)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
elif f0_method == "crepe":
|
122 |
model = "full"
|
123 |
# Pick a batch size that doesn't cause memory errors on your gpu
|
|
|
135 |
device=self.device,
|
136 |
return_periodicity=True,
|
137 |
)
|
138 |
+
pd = torchcrepe.filter.median(pd, 3)
|
139 |
+
f0 = torchcrepe.filter.mean(f0, 3)
|
140 |
+
f0[pd < 0.1] = 0
|
141 |
+
f0 = f0[0].cpu().numpy()
|
142 |
elif f0_method == "rmvpe":
|
143 |
if not hasattr(self, "model_rmvpe"):
|
144 |
from infer.lib.rmvpe import RMVPE
|