Spaces:
Runtime error
Runtime error
fix
Browse files
app.py
CHANGED
@@ -19,15 +19,14 @@ def resize2d(source, target_len):
|
|
19 |
source[source<0.001] = np.nan
|
20 |
target = np.interp(np.arange(0, len(source)*target_len, len(source))/ target_len, np.arange(0, len(source)), source)
|
21 |
return np.nan_to_num(target)
|
|
|
22 |
def convert_wav_22050_to_f0(audio):
|
23 |
-
tmp =
|
24 |
-
|
25 |
-
|
26 |
-
frame_length=1780)[0]
|
27 |
f0 = np.zeros_like(tmp)
|
28 |
-
f0[tmp>0] = tmp[tmp>0]
|
29 |
return f0
|
30 |
-
|
31 |
def get_text(text, hps):
|
32 |
text_norm = text_to_sequence(text, hps.data.text_cleaners)
|
33 |
if hps.data.add_blank:
|
|
|
19 |
source[source<0.001] = np.nan
|
20 |
target = np.interp(np.arange(0, len(source)*target_len, len(source))/ target_len, np.arange(0, len(source)), source)
|
21 |
return np.nan_to_num(target)
|
22 |
+
|
23 |
def convert_wav_22050_to_f0(audio):
|
24 |
+
tmp = torchcrepe.predict(audio=audio, fmin=50, fmax=550,
|
25 |
+
sample_rate=22050, model='full',
|
26 |
+
batch_size=2048).numpy()[0]
|
|
|
27 |
f0 = np.zeros_like(tmp)
|
28 |
+
f0[tmp > 0] = tmp[tmp > 0]
|
29 |
return f0
|
|
|
30 |
def get_text(text, hps):
|
31 |
text_norm = text_to_sequence(text, hps.data.text_cleaners)
|
32 |
if hps.data.add_blank:
|