mirror of
https://github.com/fumiama/Retrieval-based-Voice-Conversion-WebUI.git
synced 2026-06-09 20:40:48 +08:00
chore: bump librosa to version 0.10.2
There is a bug in librosa 0.9.1. https://github.com/librosa/librosa/pull/1594 As a result, an error occurs when executing the "Vocals/Accompaniment Separation & Reverberation Removal" function. To address this issue, librosa has been upgraded to version 0.10.2. Additionally, torchcrepe has been upgraded due to its dependency on librosa.
This commit is contained in:
@@ -41,8 +41,8 @@ def wave_to_spectrogram(
|
|||||||
wave_left = np.asfortranarray(wave[0])
|
wave_left = np.asfortranarray(wave[0])
|
||||||
wave_right = np.asfortranarray(wave[1])
|
wave_right = np.asfortranarray(wave[1])
|
||||||
|
|
||||||
spec_left = librosa.stft(wave_left, n_fft, hop_length=hop_length)
|
spec_left = librosa.stft(wave_left, n_fft=n_fft, hop_length=hop_length)
|
||||||
spec_right = librosa.stft(wave_right, n_fft, hop_length=hop_length)
|
spec_right = librosa.stft(wave_right, n_fft=n_fft, hop_length=hop_length)
|
||||||
|
|
||||||
spec = np.asfortranarray([spec_left, spec_right])
|
spec = np.asfortranarray([spec_left, spec_right])
|
||||||
|
|
||||||
@@ -76,7 +76,7 @@ def wave_to_spectrogram_mt(
|
|||||||
kwargs={"y": wave_left, "n_fft": n_fft, "hop_length": hop_length},
|
kwargs={"y": wave_left, "n_fft": n_fft, "hop_length": hop_length},
|
||||||
)
|
)
|
||||||
thread.start()
|
thread.start()
|
||||||
spec_right = librosa.stft(wave_right, n_fft, hop_length=hop_length)
|
spec_right = librosa.stft(wave_right, n_fft=n_fft, hop_length=hop_length)
|
||||||
thread.join()
|
thread.join()
|
||||||
|
|
||||||
spec = np.asfortranarray([spec_left, spec_right])
|
spec = np.asfortranarray([spec_left, spec_right])
|
||||||
@@ -228,26 +228,30 @@ def cache_or_load(mix_path, inst_path, mp):
|
|||||||
|
|
||||||
if d == len(mp.param["band"]): # high-end band
|
if d == len(mp.param["band"]): # high-end band
|
||||||
X_wave[d], _ = librosa.load(
|
X_wave[d], _ = librosa.load(
|
||||||
mix_path, bp["sr"], False, dtype=np.float32, res_type=bp["res_type"]
|
mix_path,
|
||||||
|
sr=bp["sr"],
|
||||||
|
mono=False,
|
||||||
|
dtype=np.float32,
|
||||||
|
res_type=bp["res_type"]
|
||||||
)
|
)
|
||||||
y_wave[d], _ = librosa.load(
|
y_wave[d], _ = librosa.load(
|
||||||
inst_path,
|
inst_path,
|
||||||
bp["sr"],
|
sr=bp["sr"],
|
||||||
False,
|
mono=False,
|
||||||
dtype=np.float32,
|
dtype=np.float32,
|
||||||
res_type=bp["res_type"],
|
res_type=bp["res_type"],
|
||||||
)
|
)
|
||||||
else: # lower bands
|
else: # lower bands
|
||||||
X_wave[d] = librosa.resample(
|
X_wave[d] = librosa.resample(
|
||||||
X_wave[d + 1],
|
X_wave[d + 1],
|
||||||
mp.param["band"][d + 1]["sr"],
|
orig_sr=mp.param["band"][d + 1]["sr"],
|
||||||
bp["sr"],
|
target_sr=bp["sr"],
|
||||||
res_type=bp["res_type"],
|
res_type=bp["res_type"],
|
||||||
)
|
)
|
||||||
y_wave[d] = librosa.resample(
|
y_wave[d] = librosa.resample(
|
||||||
y_wave[d + 1],
|
y_wave[d + 1],
|
||||||
mp.param["band"][d + 1]["sr"],
|
orig_sr=mp.param["band"][d + 1]["sr"],
|
||||||
bp["sr"],
|
target_sr=bp["sr"],
|
||||||
res_type=bp["res_type"],
|
res_type=bp["res_type"],
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -399,8 +403,8 @@ def cmb_spectrogram_to_wave(spec_m, mp, extra_bins_h=None, extra_bins=None):
|
|||||||
mp.param["mid_side_b2"],
|
mp.param["mid_side_b2"],
|
||||||
mp.param["reverse"],
|
mp.param["reverse"],
|
||||||
),
|
),
|
||||||
bp["sr"],
|
orig_sr=bp["sr"],
|
||||||
sr,
|
target_sr=sr,
|
||||||
res_type="sinc_fastest",
|
res_type="sinc_fastest",
|
||||||
)
|
)
|
||||||
else: # mid
|
else: # mid
|
||||||
@@ -417,7 +421,7 @@ def cmb_spectrogram_to_wave(spec_m, mp, extra_bins_h=None, extra_bins=None):
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
# wave = librosa.core.resample(wave2, bp['sr'], sr, res_type="sinc_fastest")
|
# wave = librosa.core.resample(wave2, bp['sr'], sr, res_type="sinc_fastest")
|
||||||
wave = librosa.core.resample(wave2, bp["sr"], sr, res_type="scipy")
|
wave = librosa.resample(wave2, orig_sr=bp["sr"], target_sr=sr, res_type="scipy")
|
||||||
|
|
||||||
return wave.T
|
return wave.T
|
||||||
|
|
||||||
@@ -504,8 +508,8 @@ def ensembling(a, specs):
|
|||||||
def stft(wave, nfft, hl):
|
def stft(wave, nfft, hl):
|
||||||
wave_left = np.asfortranarray(wave[0])
|
wave_left = np.asfortranarray(wave[0])
|
||||||
wave_right = np.asfortranarray(wave[1])
|
wave_right = np.asfortranarray(wave[1])
|
||||||
spec_left = librosa.stft(wave_left, nfft, hop_length=hl)
|
spec_left = librosa.stft(wave_left, n_fft=nfft, hop_length=hl)
|
||||||
spec_right = librosa.stft(wave_right, nfft, hop_length=hl)
|
spec_right = librosa.stft(wave_right, n_fft=nfft, hop_length=hl)
|
||||||
spec = np.asfortranarray([spec_left, spec_right])
|
spec = np.asfortranarray([spec_left, spec_right])
|
||||||
|
|
||||||
return spec
|
return spec
|
||||||
|
|||||||
@@ -61,20 +61,20 @@ class AudioPre:
|
|||||||
(
|
(
|
||||||
X_wave[d],
|
X_wave[d],
|
||||||
_,
|
_,
|
||||||
) = librosa.core.load( # 理论上librosa读取可能对某些音频有bug,应该上av读取,但是太麻烦了弃坑
|
) = librosa.load( # 理论上librosa读取可能对某些音频有bug,应该上ffmpeg读取,但是太麻烦了弃坑
|
||||||
music_file,
|
music_file,
|
||||||
bp["sr"],
|
sr=bp["sr"],
|
||||||
False,
|
mono=False,
|
||||||
dtype=np.float32,
|
dtype=np.float32,
|
||||||
res_type=bp["res_type"],
|
res_type=bp["res_type"],
|
||||||
)
|
)
|
||||||
if X_wave[d].ndim == 1:
|
if X_wave[d].ndim == 1:
|
||||||
X_wave[d] = np.asfortranarray([X_wave[d], X_wave[d]])
|
X_wave[d] = np.asfortranarray([X_wave[d], X_wave[d]])
|
||||||
else: # lower bands
|
else: # lower bands
|
||||||
X_wave[d] = librosa.core.resample(
|
X_wave[d] = librosa.resample(
|
||||||
X_wave[d + 1],
|
X_wave[d + 1],
|
||||||
self.mp.param["band"][d + 1]["sr"],
|
orig_sr=self.mp.param["band"][d + 1]["sr"],
|
||||||
bp["sr"],
|
target_sr=bp["sr"],
|
||||||
res_type=bp["res_type"],
|
res_type=bp["res_type"],
|
||||||
)
|
)
|
||||||
# Stft of wave source
|
# Stft of wave source
|
||||||
@@ -231,20 +231,20 @@ class AudioPreDeEcho:
|
|||||||
(
|
(
|
||||||
X_wave[d],
|
X_wave[d],
|
||||||
_,
|
_,
|
||||||
) = librosa.core.load( # 理论上librosa读取可能对某些音频有bug,应该上av读取,但是太麻烦了弃坑
|
) = librosa.load( # 理论上librosa读取可能对某些音频有bug,应该上ffmpeg读取,但是太麻烦了弃坑
|
||||||
music_file,
|
music_file,
|
||||||
bp["sr"],
|
sr=bp["sr"],
|
||||||
False,
|
mono=False,
|
||||||
dtype=np.float32,
|
dtype=np.float32,
|
||||||
res_type=bp["res_type"],
|
res_type=bp["res_type"],
|
||||||
)
|
)
|
||||||
if X_wave[d].ndim == 1:
|
if X_wave[d].ndim == 1:
|
||||||
X_wave[d] = np.asfortranarray([X_wave[d], X_wave[d]])
|
X_wave[d] = np.asfortranarray([X_wave[d], X_wave[d]])
|
||||||
else: # lower bands
|
else: # lower bands
|
||||||
X_wave[d] = librosa.core.resample(
|
X_wave[d] = librosa.resample(
|
||||||
X_wave[d + 1],
|
X_wave[d + 1],
|
||||||
self.mp.param["band"][d + 1]["sr"],
|
orig_sr=self.mp.param["band"][d + 1]["sr"],
|
||||||
bp["sr"],
|
target_sr=bp["sr"],
|
||||||
res_type=bp["res_type"],
|
res_type=bp["res_type"],
|
||||||
)
|
)
|
||||||
# Stft of wave source
|
# Stft of wave source
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ joblib>=1.1.0
|
|||||||
numba==0.56.4
|
numba==0.56.4
|
||||||
numpy==1.23.5
|
numpy==1.23.5
|
||||||
scipy
|
scipy
|
||||||
librosa==0.9.1
|
librosa==0.10.2
|
||||||
llvmlite==0.39.0
|
llvmlite==0.39.0
|
||||||
fairseq==0.12.2
|
fairseq==0.12.2
|
||||||
faiss-cpu==1.7.3
|
faiss-cpu==1.7.3
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ joblib>=1.1.0
|
|||||||
numba==0.56.4
|
numba==0.56.4
|
||||||
numpy==1.23.5
|
numpy==1.23.5
|
||||||
scipy
|
scipy
|
||||||
librosa==0.9.1
|
librosa==0.10.2
|
||||||
llvmlite==0.39.0
|
llvmlite==0.39.0
|
||||||
fairseq==0.12.2
|
fairseq==0.12.2
|
||||||
faiss-cpu==1.7.3
|
faiss-cpu==1.7.3
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ joblib>=1.1.0
|
|||||||
numba==0.56.4
|
numba==0.56.4
|
||||||
numpy==1.23.5
|
numpy==1.23.5
|
||||||
scipy
|
scipy
|
||||||
librosa==0.9.1
|
librosa==0.10.2
|
||||||
llvmlite==0.39.0
|
llvmlite==0.39.0
|
||||||
fairseq==0.12.2
|
fairseq==0.12.2
|
||||||
faiss-cpu==1.7.3
|
faiss-cpu==1.7.3
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ joblib>=1.1.0
|
|||||||
numba
|
numba
|
||||||
numpy==1.23.5
|
numpy==1.23.5
|
||||||
scipy
|
scipy
|
||||||
librosa==0.9.1
|
librosa==0.10.2
|
||||||
llvmlite
|
llvmlite
|
||||||
fairseq
|
fairseq
|
||||||
faiss-cpu
|
faiss-cpu
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ joblib>=1.1.0
|
|||||||
numba
|
numba
|
||||||
numpy
|
numpy
|
||||||
scipy
|
scipy
|
||||||
librosa==0.9.1
|
librosa==0.10.2
|
||||||
llvmlite
|
llvmlite
|
||||||
fairseq @ git+https://github.com/One-sixth/fairseq.git
|
fairseq @ git+https://github.com/One-sixth/fairseq.git
|
||||||
faiss-cpu
|
faiss-cpu
|
||||||
|
|||||||
Reference in New Issue
Block a user