kevinwang676 commited on
Commit
532d096
1 Parent(s): 2ece7cb

Update vc_infer_pipeline.py

Browse files
Files changed (1) hide show
  1. vc_infer_pipeline.py +1 -11
vc_infer_pipeline.py CHANGED
@@ -223,10 +223,7 @@ class VC(object):
223
  )
224
 
225
  feats = F.interpolate(feats.permute(0, 2, 1), scale_factor=2).permute(0, 2, 1)
226
- if protect < 0.5 and pitch != None and pitchf != None:
227
- feats0 = F.interpolate(feats0.permute(0, 2, 1), scale_factor=2).permute(
228
- 0, 2, 1
229
- )
230
  t1 = ttime()
231
  p_len = audio0.shape[0] // self.window
232
  if feats.shape[1] < p_len:
@@ -235,13 +232,6 @@ class VC(object):
235
  pitch = pitch[:, :p_len]
236
  pitchf = pitchf[:, :p_len]
237
 
238
- if protect < 0.5 and pitch != None and pitchf != None:
239
- pitchff = pitchf.clone()
240
- pitchff[pitchf > 0] = 1
241
- pitchff[pitchf < 1] = protect
242
- pitchff = pitchff.unsqueeze(-1)
243
- feats = feats * pitchff + feats0 * (1 - pitchff)
244
- feats = feats.to(feats0.dtype)
245
  p_len = torch.tensor([p_len], device=self.device).long()
246
  with torch.no_grad():
247
  if pitch != None and pitchf != None:
 
223
  )
224
 
225
  feats = F.interpolate(feats.permute(0, 2, 1), scale_factor=2).permute(0, 2, 1)
226
+
 
 
 
227
  t1 = ttime()
228
  p_len = audio0.shape[0] // self.window
229
  if feats.shape[1] < p_len:
 
232
  pitch = pitch[:, :p_len]
233
  pitchf = pitchf[:, :p_len]
234
 
 
 
 
 
 
 
 
235
  p_len = torch.tensor([p_len], device=self.device).long()
236
  with torch.no_grad():
237
  if pitch != None and pitchf != None: