Blane187 commited on
Commit
2bdebad
·
verified ·
1 Parent(s): 958e3ae

Update vc_infer_pipeline.py

Browse files
Files changed (1) hide show
  1. vc_infer_pipeline.py +15 -4
vc_infer_pipeline.py CHANGED
@@ -1,12 +1,23 @@
1
- import numpy as np, parselmouth, torch, pdb, sys, os
 
 
 
 
2
  from time import time as ttime
3
  import torch.nn.functional as F
4
  import torchcrepe # Fork feature. Use the crepe f0 algorithm. New dependency (pip install torchcrepe)
5
  from torch import Tensor
6
  import scipy.signal as signal
7
- import pyworld, os, traceback, faiss, librosa, torchcrepe
 
 
 
 
 
8
  from scipy import signal
9
  from functools import lru_cache
 
 
10
 
11
  now_dir = os.getcwd()
12
  sys.path.append(now_dir)
@@ -303,11 +314,11 @@ class VC(object):
303
  f0 = self.get_f0_official_crepe_computation(x, f0_min, f0_max)
304
  elif f0_method == "crepe-tiny":
305
  f0 = self.get_f0_official_crepe_computation(x, f0_min, f0_max, "tiny")
306
- elif f0_method == "mangio-crepe":
307
  f0 = self.get_f0_crepe_computation(
308
  x, f0_min, f0_max, p_len, crepe_hop_length
309
  )
310
- elif f0_method == "mangio-crepe-tiny":
311
  f0 = self.get_f0_crepe_computation(
312
  x, f0_min, f0_max, p_len, crepe_hop_length, "tiny"
313
  )
 
1
+ import numpy as np
2
+ import parselmouth
3
+ import torch
4
+ import pdb
5
+ import sys
6
  from time import time as ttime
7
  import torch.nn.functional as F
8
  import torchcrepe # Fork feature. Use the crepe f0 algorithm. New dependency (pip install torchcrepe)
9
  from torch import Tensor
10
  import scipy.signal as signal
11
+ import pyworld
12
+ import os
13
+ import traceback
14
+ import faiss
15
+ import librosa
16
+ import torchcrepe
17
  from scipy import signal
18
  from functools import lru_cache
19
+ import gc, re
20
+ import random
21
 
22
  now_dir = os.getcwd()
23
  sys.path.append(now_dir)
 
314
  f0 = self.get_f0_official_crepe_computation(x, f0_min, f0_max)
315
  elif f0_method == "crepe-tiny":
316
  f0 = self.get_f0_official_crepe_computation(x, f0_min, f0_max, "tiny")
317
+ elif f0_method == "hex-crepe":
318
  f0 = self.get_f0_crepe_computation(
319
  x, f0_min, f0_max, p_len, crepe_hop_length
320
  )
321
+ elif f0_method == "hex-crepe-tiny":
322
  f0 = self.get_f0_crepe_computation(
323
  x, f0_min, f0_max, p_len, crepe_hop_length, "tiny"
324
  )