1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
|
diff --git a/UVR.py b/UVR.py
index 09f0de4..89fb071 100644
--- a/UVR.py
+++ b/UVR.py
@@ -62,8 +62,8 @@ from os.path import expanduser
# import faulthandler
# faulthandler.enable()
-if not is_macos:
- import torch_directml # type:ignore
+# if not is_macos:
+# import torch_directml # type:ignore
is_choose_arch = cuda_available and directml_available
is_directml_only = not cuda_available and directml_available
diff --git a/gui_data/app_size_values.py b/gui_data/app_size_values.py
index 4839f81..e1d456b 100644
--- a/gui_data/app_size_values.py
+++ b/gui_data/app_size_values.py
@@ -132,9 +132,9 @@ class ImagePath():
if size is not None:
size = (int(size[0]), int(size[1]))
if keep_aspect:
- img = img.resize((size[0], int(size[0] * ratio)), Image.ANTIALIAS)
+ img = img.resize((size[0], int(size[0] * ratio)), Image.LANCZOS)
else:
- img = img.resize(size, Image.ANTIALIAS)
+ img = img.resize(size, Image.LANCZOS)
return ImageTk.PhotoImage(img)
diff --git a/lib_v5/apollo_inference.py b/lib_v5/apollo_inference.py
index 8ce47a9..6d8cdd1 100644
--- a/lib_v5/apollo_inference.py
+++ b/lib_v5/apollo_inference.py
@@ -11,8 +11,8 @@ from separate import (get_gpu_info, clear_gpu_cache,
import warnings
warnings.filterwarnings("ignore")
-if not is_macos:
- import torch_directml # type:ignore
+# if not is_macos:
+# import torch_directml # type:ignore
DIRECTML_DEVICE, directml_available = get_gpu_info()
is_choose_arch = cuda_available and directml_available
@@ -157,4 +157,4 @@ def restore_process(input_wav, ckpt_path, overlap=2, chunk_size=10, set_progress
del model
clear_gpu_cache()
- return final_output
\ No newline at end of file
+ return final_output
diff --git a/lib_v5/spec_utils.py b/lib_v5/spec_utils.py
index 9f75e2c..103497a 100644
--- a/lib_v5/spec_utils.py
+++ b/lib_v5/spec_utils.py
@@ -271,8 +271,8 @@ def wave_to_spectrogram(wave, hop_length, n_fft, mp, band, is_v51_model=False):
wave_left = np.asfortranarray(wave[0])
wave_right = np.asfortranarray(wave[1])
- spec_left = librosa.stft(wave_left, n_fft, hop_length=hop_length)
- spec_right = librosa.stft(wave_right, 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=n_fft, hop_length=hop_length)
spec = np.asfortranarray([spec_left, spec_right])
@@ -337,7 +337,7 @@ def cmb_spectrogram_to_wave(spec_m, mp, extra_bins_h=None, extra_bins=None, is_v
spec_s *= get_lp_filter_mask(spec_s.shape[1], bp['lpf_start'], bp['lpf_stop'])
else:
spec_s = fft_lp_filter(spec_s, bp['lpf_start'], bp['lpf_stop'])
- wave = librosa.resample(spectrogram_to_wave(spec_s, bp['hl'], mp, d, is_v51_model), bp['sr'], sr, res_type=wav_resolution)
+ wave = librosa.resample(spectrogram_to_wave(spec_s, bp['hl'], mp, d, is_v51_model), orig_sr=bp['sr'], target_sr=sr, res_type=wav_resolution)
else: # mid
if is_v51_model:
spec_s *= get_hp_filter_mask(spec_s.shape[1], bp['hpf_start'], bp['hpf_stop'] - 1)
@@ -347,7 +347,7 @@ def cmb_spectrogram_to_wave(spec_m, mp, extra_bins_h=None, extra_bins=None, is_v
spec_s = fft_lp_filter(spec_s, bp['lpf_start'], bp['lpf_stop'])
wave2 = np.add(wave, spectrogram_to_wave(spec_s, bp['hl'], mp, d, is_v51_model))
- wave = librosa.resample(wave2, bp['sr'], sr, res_type=wav_resolution)
+ wave = librosa.resample(wave2, orig_sr=bp['sr'], target_sr=sr, res_type=wav_resolution)
return wave
@@ -406,8 +406,8 @@ def wave_to_spectrogram_old(wave, hop_length, n_fft):
wave_left = np.asfortranarray(wave[0])
wave_right = np.asfortranarray(wave[1])
- spec_left = librosa.stft(wave_left, n_fft, hop_length=hop_length)
- spec_right = librosa.stft(wave_right, 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=n_fft, hop_length=hop_length)
spec = np.asfortranarray([spec_left, spec_right])
diff --git a/separate.py b/separate.py
index 6ee4e05..1b31394 100644
--- a/separate.py
+++ b/separate.py
@@ -41,8 +41,8 @@ import gc
if TYPE_CHECKING:
from UVR import ModelData
-if not is_macos:
- import torch_directml # type:ignore
+# if not is_macos:
+# import torch_directml # type:ignore
mps_available = torch.backends.mps.is_available() if is_macos else False
cuda_available = torch.cuda.is_available()
@@ -51,11 +51,11 @@ default_sr = 44100
def get_gpu_info():
directml_device, directml_available = DIRECTML_DEVICE, False
- if not is_macos:
- directml_available = torch_directml.is_available()
-
- if directml_available:
- directml_device = str(torch_directml.device()).partition(":")[0]
+ # if not is_macos:
+ # directml_available = torch_directml.is_available()
+ #
+ # if directml_available:
+ # directml_device = str(torch_directml.device()).partition(":")[0]
return directml_device, directml_available
@@ -1203,14 +1203,14 @@ class SeperateVR(SeperateAttributes):
if d == bands_n: # high-end band
- X_wave[d], _ = librosa.load(audio_file, bp['sr'], False, dtype=np.float32, res_type=wav_resolution)
+ X_wave[d], _ = librosa.load(audio_file, sr=bp['sr'], mono=False, dtype=np.float32, res_type=wav_resolution)
X_spec_s[d] = spec_utils.wave_to_spectrogram(X_wave[d], bp['hl'], bp['n_fft'], self.mp, band=d, is_v51_model=self.is_vr_51_model)
if not np.any(X_wave[d]) and is_mp3:
X_wave[d] = rerun_mp3(audio_file, bp['sr'])
if X_wave[d].ndim == 1:
X_wave[d] = np.asarray([X_wave[d], X_wave[d]])
else: # lower bands
- X_wave[d] = librosa.resample(X_wave[d+1], self.mp.param['band'][d+1]['sr'], bp['sr'], res_type=wav_resolution)
+ X_wave[d] = librosa.resample(X_wave[d+1], orig_sr=self.mp.param['band'][d+1]['sr'], target_sr=bp['sr'], res_type=wav_resolution)
X_spec_s[d] = spec_utils.wave_to_spectrogram(X_wave[d], bp['hl'], bp['n_fft'], self.mp, band=d, is_v51_model=self.is_vr_51_model)
if d == bands_n and self.high_end_process != 'none':
@@ -1541,7 +1541,7 @@ def loading_mix(X, mp):
X_wave[d] = X
else: # lower bands
- X_wave[d] = librosa.resample(X_wave[d+1], mp.param['band'][d+1]['sr'], bp['sr'], res_type=wav_resolution)
+ X_wave[d] = librosa.resample(X_wave[d+1], orig_sr=mp.param['band'][d+1]['sr'], target_sr=bp['sr'], res_type=wav_resolution)
X_spec_s[d] = spec_utils.wave_to_spectrogram(X_wave[d], bp['hl'], bp['n_fft'], mp, band=d, is_v51_model=True)
|