theNeofr commited on
Commit
929c5a6
·
verified ·
1 Parent(s): 01dde08

Update vc_infer_pipeline.py

Browse files
Files changed (1) hide show
  1. vc_infer_pipeline.py +8 -25
vc_infer_pipeline.py CHANGED
@@ -191,20 +191,13 @@ class VC(object):
191
  elif method == "rmvpe":
192
  if hasattr(self, "model_rmvpe") == False:
193
 
194
- self.model_rmvpe = RMVPE(
195
- download_rmvpe(), is_half=self.is_half, device=self.device
196
- )
197
  f0 = self.model_rmvpe.infer_from_audio(x, thred=0.03)
198
  f0 = f0[1:]
199
  elif method == "fcpe":
200
  self.model_fcpe = FCPEF0Predictor(
201
- download_fcpe(),
202
- f0_min=int(f0_min),
203
- f0_max=int(f0_max),
204
- dtype=torch.float32,
205
- device=self.device,
206
- sampling_rate=self.sr,
207
- threshold=0.03,
208
  )
209
  f0 = self.model_fcpe.compute_f0(x, p_len=p_len)
210
  del self.model_fcpe
@@ -280,9 +273,8 @@ class VC(object):
280
  elif f0_method == "rmvpe":
281
  if hasattr(self, "model_rmvpe") == False:
282
 
283
- self.model_rmvpe = RMVPE(
284
- download_rmvpe(), is_half=self.is_half, device=self.device
285
- )
286
  f0 = self.model_rmvpe.infer_from_audio(x, thred=0.03)
287
 
288
  elif f0_method == "rmvpe+":
@@ -294,13 +286,7 @@ class VC(object):
294
 
295
  elif f0_method == "fcpe":
296
  self.model_fcpe = FCPEF0Predictor(
297
- download_fcpe(),
298
- f0_min=int(f0_min),
299
- f0_max=int(f0_max),
300
- dtype=torch.float32,
301
- device=self.device,
302
- sampling_rate=self.sr,
303
- threshold=0.03,
304
  )
305
  f0 = self.model_fcpe.compute_f0(x, p_len=p_len)
306
  del self.model_fcpe
@@ -347,11 +333,8 @@ class VC(object):
347
  def get_pitch_dependant_rmvpe(self, x, f0_min=1, f0_max=40000, *args, **kwargs):
348
  if not hasattr(self, "model_rmvpe"):
349
 
350
- self.model_rmvpe = RMVPE(
351
- download_rmvpe(),
352
- is_half=self.is_half,
353
- device=self.device,
354
- )
355
 
356
  f0 = self.model_rmvpe.infer_from_audio_with_pitch(x, thred=0.03, f0_min=f0_min, f0_max=f0_max)
357
 
 
191
  elif method == "rmvpe":
192
  if hasattr(self, "model_rmvpe") == False:
193
 
194
+ self.model_rmvpe = RMVPE(download_rmvpe(), is_half=self.is_half, device=self.device)
195
+
 
196
  f0 = self.model_rmvpe.infer_from_audio(x, thred=0.03)
197
  f0 = f0[1:]
198
  elif method == "fcpe":
199
  self.model_fcpe = FCPEF0Predictor(
200
+ download_fcpe(), f0_min=int(f0_min), f0_max=int(f0_max), dtype=torch.float32, device=self.device
 
 
 
 
 
 
201
  )
202
  f0 = self.model_fcpe.compute_f0(x, p_len=p_len)
203
  del self.model_fcpe
 
273
  elif f0_method == "rmvpe":
274
  if hasattr(self, "model_rmvpe") == False:
275
 
276
+ self.model_rmvpe = RMVPE(download_rmvpe(), is_half=self.is_half, device=self.device)
277
+
 
278
  f0 = self.model_rmvpe.infer_from_audio(x, thred=0.03)
279
 
280
  elif f0_method == "rmvpe+":
 
286
 
287
  elif f0_method == "fcpe":
288
  self.model_fcpe = FCPEF0Predictor(
289
+ download_fcpe(), f0_min=int(f0_min), f0_max=int(f0_max), dtype=torch.float32, device=self.device
 
 
 
 
 
 
290
  )
291
  f0 = self.model_fcpe.compute_f0(x, p_len=p_len)
292
  del self.model_fcpe
 
333
  def get_pitch_dependant_rmvpe(self, x, f0_min=1, f0_max=40000, *args, **kwargs):
334
  if not hasattr(self, "model_rmvpe"):
335
 
336
+ self.model_rmvpe = RMVPE(download_rmvpe(), is_half=self.is_half, device=self.device)
337
+
 
 
 
338
 
339
  f0 = self.model_rmvpe.infer_from_audio_with_pitch(x, thred=0.03, f0_min=f0_min, f0_max=f0_max)
340