Skip to content

Commit 1e94e00

Browse files
committed
optimize(rvc.f0): rename inner defs
1 parent 8314486 commit 1e94e00

File tree

6 files changed

+6
-7
lines changed

6 files changed

+6
-7
lines changed

infer/modules/vc/pipeline.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import faiss
1111
import librosa
1212
import numpy as np
13-
import pyworld
1413
import torch
1514
import torch.nn.functional as F
1615
import torchcrepe

rvc/f0/dio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ def compute_f0(
2828
f0 = pyworld.stonemask(wav.astype(np.double), f0, t, self.sampling_rate)
2929
for index, pitch in enumerate(f0):
3030
f0[index] = round(pitch, 1)
31-
return self.interpolate_f0(self.resize_f0(f0, p_len))[0]
31+
return self._interpolate_f0(self._resize_f0(f0, p_len))[0]

rvc/f0/f0.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def compute_f0(
1717
filter_radius: Optional[Union[int, float]] = None,
1818
): ...
1919

20-
def interpolate_f0(self, f0: np.ndarray[Any, np.dtype]):
20+
def _interpolate_f0(self, f0: np.ndarray[Any, np.dtype]):
2121
"""
2222
对F0进行插值处理
2323
"""
@@ -55,7 +55,7 @@ def interpolate_f0(self, f0: np.ndarray[Any, np.dtype]):
5555

5656
return ip_data[:, 0], vuv_vector[:, 0]
5757

58-
def resize_f0(self, x: np.ndarray[Any, np.dtype], target_len: int):
58+
def _resize_f0(self, x: np.ndarray[Any, np.dtype], target_len: int):
5959
source = np.array(x)
6060
source[source < 0.001] = np.nan
6161
target = np.interp(

rvc/f0/harvest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ def compute_f0(
2929
f0 = pyworld.stonemask(wav.astype(np.double), f0, t, self.sampling_rate)
3030
if filter_radius is not None and filter_radius > 2:
3131
f0 = signal.medfilt(f0, 3)
32-
return self.interpolate_f0(self.resize_f0(f0, p_len))[0]
32+
return self._interpolate_f0(self._resize_f0(f0, p_len))[0]

rvc/f0/pm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ def compute_f0(
3636
pad_size = (p_len - len(f0) + 1) // 2
3737
if pad_size > 0 or p_len - len(f0) - pad_size > 0:
3838
f0 = np.pad(f0, [[pad_size, p_len - len(f0) - pad_size]], mode="constant")
39-
return self.interpolate_f0(f0)[0]
39+
return self._interpolate_f0(f0)[0]

rvc/f0/rmvpe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def compute_f0(
122122

123123
f0 = self._decode(hidden, thred=filter_radius)
124124

125-
return self.interpolate_f0(self.resize_f0(f0, p_len))[0]
125+
return self._interpolate_f0(self._resize_f0(f0, p_len))[0]
126126

127127
def _to_local_average_cents(self, salience, threshold=0.05):
128128
center = np.argmax(salience, axis=1) # 帧长#index

0 commit comments

Comments
 (0)