Upload 68 files
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- echo/.gitkeep +0 -0
- input/.gitkeep +0 -0
- output/.gitkeep +0 -0
- uvr5_pack/lib_v5/__pycache__/layers.cpython-310.pyc +0 -0
- uvr5_pack/lib_v5/__pycache__/layers_123821KB.cpython-310.pyc +0 -0
- uvr5_pack/lib_v5/__pycache__/layers_123821KB.cpython-38.pyc +0 -0
- uvr5_pack/lib_v5/__pycache__/layers_123821KB.cpython-39.pyc +0 -0
- uvr5_pack/lib_v5/__pycache__/layers_new.cpython-310.pyc +0 -0
- uvr5_pack/lib_v5/__pycache__/layers_new.cpython-38.pyc +0 -0
- uvr5_pack/lib_v5/__pycache__/layers_new.cpython-39.pyc +0 -0
- uvr5_pack/lib_v5/__pycache__/model_param_init.cpython-310.pyc +0 -0
- uvr5_pack/lib_v5/__pycache__/model_param_init.cpython-38.pyc +0 -0
- uvr5_pack/lib_v5/__pycache__/model_param_init.cpython-39.pyc +0 -0
- uvr5_pack/lib_v5/__pycache__/nets.cpython-310.pyc +0 -0
- uvr5_pack/lib_v5/__pycache__/nets_61968KB.cpython-310.pyc +0 -0
- uvr5_pack/lib_v5/__pycache__/nets_61968KB.cpython-38.pyc +0 -0
- uvr5_pack/lib_v5/__pycache__/nets_61968KB.cpython-39.pyc +0 -0
- uvr5_pack/lib_v5/__pycache__/nets_new.cpython-310.pyc +0 -0
- uvr5_pack/lib_v5/__pycache__/nets_new.cpython-38.pyc +0 -0
- uvr5_pack/lib_v5/__pycache__/nets_new.cpython-39.pyc +0 -0
- uvr5_pack/lib_v5/__pycache__/spec_utils.cpython-310.pyc +0 -0
- uvr5_pack/lib_v5/__pycache__/spec_utils.cpython-38.pyc +0 -0
- uvr5_pack/lib_v5/__pycache__/spec_utils.cpython-39.pyc +0 -0
- uvr5_pack/lib_v5/dataset.py +183 -0
- uvr5_pack/lib_v5/layers.py +118 -0
- uvr5_pack/lib_v5/layers_123812KB .py +118 -0
- uvr5_pack/lib_v5/layers_123821KB.py +118 -0
- uvr5_pack/lib_v5/layers_33966KB.py +126 -0
- uvr5_pack/lib_v5/layers_537227KB.py +126 -0
- uvr5_pack/lib_v5/layers_537238KB.py +126 -0
- uvr5_pack/lib_v5/layers_new.py +126 -0
- uvr5_pack/lib_v5/model_param_init.py +69 -0
- uvr5_pack/lib_v5/modelparams/1band_sr16000_hl512.json +19 -0
- uvr5_pack/lib_v5/modelparams/1band_sr32000_hl512.json +19 -0
- uvr5_pack/lib_v5/modelparams/1band_sr33075_hl384.json +19 -0
- uvr5_pack/lib_v5/modelparams/1band_sr44100_hl1024.json +19 -0
- uvr5_pack/lib_v5/modelparams/1band_sr44100_hl256.json +19 -0
- uvr5_pack/lib_v5/modelparams/1band_sr44100_hl512.json +19 -0
- uvr5_pack/lib_v5/modelparams/1band_sr44100_hl512_cut.json +19 -0
- uvr5_pack/lib_v5/modelparams/2band_32000.json +30 -0
- uvr5_pack/lib_v5/modelparams/2band_44100_lofi.json +30 -0
- uvr5_pack/lib_v5/modelparams/2band_48000.json +30 -0
- uvr5_pack/lib_v5/modelparams/3band_44100.json +42 -0
- uvr5_pack/lib_v5/modelparams/3band_44100_mid.json +43 -0
- uvr5_pack/lib_v5/modelparams/3band_44100_msb2.json +43 -0
- uvr5_pack/lib_v5/modelparams/4band_44100.json +54 -0
- uvr5_pack/lib_v5/modelparams/4band_44100_mid.json +55 -0
- uvr5_pack/lib_v5/modelparams/4band_44100_msb.json +55 -0
- uvr5_pack/lib_v5/modelparams/4band_44100_msb2.json +55 -0
- uvr5_pack/lib_v5/modelparams/4band_44100_reverse.json +55 -0
echo/.gitkeep
ADDED
File without changes
|
input/.gitkeep
ADDED
File without changes
|
output/.gitkeep
ADDED
File without changes
|
uvr5_pack/lib_v5/__pycache__/layers.cpython-310.pyc
ADDED
Binary file (4.06 kB). View file
|
|
uvr5_pack/lib_v5/__pycache__/layers_123821KB.cpython-310.pyc
ADDED
Binary file (4.07 kB). View file
|
|
uvr5_pack/lib_v5/__pycache__/layers_123821KB.cpython-38.pyc
ADDED
Binary file (4.17 kB). View file
|
|
uvr5_pack/lib_v5/__pycache__/layers_123821KB.cpython-39.pyc
ADDED
Binary file (4.13 kB). View file
|
|
uvr5_pack/lib_v5/__pycache__/layers_new.cpython-310.pyc
ADDED
Binary file (4.44 kB). View file
|
|
uvr5_pack/lib_v5/__pycache__/layers_new.cpython-38.pyc
ADDED
Binary file (4.45 kB). View file
|
|
uvr5_pack/lib_v5/__pycache__/layers_new.cpython-39.pyc
ADDED
Binary file (4.44 kB). View file
|
|
uvr5_pack/lib_v5/__pycache__/model_param_init.cpython-310.pyc
ADDED
Binary file (1.63 kB). View file
|
|
uvr5_pack/lib_v5/__pycache__/model_param_init.cpython-38.pyc
ADDED
Binary file (1.58 kB). View file
|
|
uvr5_pack/lib_v5/__pycache__/model_param_init.cpython-39.pyc
ADDED
Binary file (1.64 kB). View file
|
|
uvr5_pack/lib_v5/__pycache__/nets.cpython-310.pyc
ADDED
Binary file (3.46 kB). View file
|
|
uvr5_pack/lib_v5/__pycache__/nets_61968KB.cpython-310.pyc
ADDED
Binary file (3.45 kB). View file
|
|
uvr5_pack/lib_v5/__pycache__/nets_61968KB.cpython-38.pyc
ADDED
Binary file (3.47 kB). View file
|
|
uvr5_pack/lib_v5/__pycache__/nets_61968KB.cpython-39.pyc
ADDED
Binary file (3.47 kB). View file
|
|
uvr5_pack/lib_v5/__pycache__/nets_new.cpython-310.pyc
ADDED
Binary file (3.79 kB). View file
|
|
uvr5_pack/lib_v5/__pycache__/nets_new.cpython-38.pyc
ADDED
Binary file (3.81 kB). View file
|
|
uvr5_pack/lib_v5/__pycache__/nets_new.cpython-39.pyc
ADDED
Binary file (3.82 kB). View file
|
|
uvr5_pack/lib_v5/__pycache__/spec_utils.cpython-310.pyc
ADDED
Binary file (13.6 kB). View file
|
|
uvr5_pack/lib_v5/__pycache__/spec_utils.cpython-38.pyc
ADDED
Binary file (13.6 kB). View file
|
|
uvr5_pack/lib_v5/__pycache__/spec_utils.cpython-39.pyc
ADDED
Binary file (13.7 kB). View file
|
|
uvr5_pack/lib_v5/dataset.py
ADDED
@@ -0,0 +1,183 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
import random
|
3 |
+
|
4 |
+
import numpy as np
|
5 |
+
import torch
|
6 |
+
import torch.utils.data
|
7 |
+
from tqdm import tqdm
|
8 |
+
|
9 |
+
from uvr5_pack.lib_v5 import spec_utils
|
10 |
+
|
11 |
+
|
12 |
+
class VocalRemoverValidationSet(torch.utils.data.Dataset):
|
13 |
+
def __init__(self, patch_list):
|
14 |
+
self.patch_list = patch_list
|
15 |
+
|
16 |
+
def __len__(self):
|
17 |
+
return len(self.patch_list)
|
18 |
+
|
19 |
+
def __getitem__(self, idx):
|
20 |
+
path = self.patch_list[idx]
|
21 |
+
data = np.load(path)
|
22 |
+
|
23 |
+
X, y = data["X"], data["y"]
|
24 |
+
|
25 |
+
X_mag = np.abs(X)
|
26 |
+
y_mag = np.abs(y)
|
27 |
+
|
28 |
+
return X_mag, y_mag
|
29 |
+
|
30 |
+
|
31 |
+
def make_pair(mix_dir, inst_dir):
|
32 |
+
input_exts = [".wav", ".m4a", ".mp3", ".mp4", ".flac"]
|
33 |
+
|
34 |
+
X_list = sorted(
|
35 |
+
[
|
36 |
+
os.path.join(mix_dir, fname)
|
37 |
+
for fname in os.listdir(mix_dir)
|
38 |
+
if os.path.splitext(fname)[1] in input_exts
|
39 |
+
]
|
40 |
+
)
|
41 |
+
y_list = sorted(
|
42 |
+
[
|
43 |
+
os.path.join(inst_dir, fname)
|
44 |
+
for fname in os.listdir(inst_dir)
|
45 |
+
if os.path.splitext(fname)[1] in input_exts
|
46 |
+
]
|
47 |
+
)
|
48 |
+
|
49 |
+
filelist = list(zip(X_list, y_list))
|
50 |
+
|
51 |
+
return filelist
|
52 |
+
|
53 |
+
|
54 |
+
def train_val_split(dataset_dir, split_mode, val_rate, val_filelist):
|
55 |
+
if split_mode == "random":
|
56 |
+
filelist = make_pair(
|
57 |
+
os.path.join(dataset_dir, "mixtures"),
|
58 |
+
os.path.join(dataset_dir, "instruments"),
|
59 |
+
)
|
60 |
+
|
61 |
+
random.shuffle(filelist)
|
62 |
+
|
63 |
+
if len(val_filelist) == 0:
|
64 |
+
val_size = int(len(filelist) * val_rate)
|
65 |
+
train_filelist = filelist[:-val_size]
|
66 |
+
val_filelist = filelist[-val_size:]
|
67 |
+
else:
|
68 |
+
train_filelist = [
|
69 |
+
pair for pair in filelist if list(pair) not in val_filelist
|
70 |
+
]
|
71 |
+
elif split_mode == "subdirs":
|
72 |
+
if len(val_filelist) != 0:
|
73 |
+
raise ValueError(
|
74 |
+
"The `val_filelist` option is not available in `subdirs` mode"
|
75 |
+
)
|
76 |
+
|
77 |
+
train_filelist = make_pair(
|
78 |
+
os.path.join(dataset_dir, "training/mixtures"),
|
79 |
+
os.path.join(dataset_dir, "training/instruments"),
|
80 |
+
)
|
81 |
+
|
82 |
+
val_filelist = make_pair(
|
83 |
+
os.path.join(dataset_dir, "validation/mixtures"),
|
84 |
+
os.path.join(dataset_dir, "validation/instruments"),
|
85 |
+
)
|
86 |
+
|
87 |
+
return train_filelist, val_filelist
|
88 |
+
|
89 |
+
|
90 |
+
def augment(X, y, reduction_rate, reduction_mask, mixup_rate, mixup_alpha):
|
91 |
+
perm = np.random.permutation(len(X))
|
92 |
+
for i, idx in enumerate(tqdm(perm)):
|
93 |
+
if np.random.uniform() < reduction_rate:
|
94 |
+
y[idx] = spec_utils.reduce_vocal_aggressively(
|
95 |
+
X[idx], y[idx], reduction_mask
|
96 |
+
)
|
97 |
+
|
98 |
+
if np.random.uniform() < 0.5:
|
99 |
+
# swap channel
|
100 |
+
X[idx] = X[idx, ::-1]
|
101 |
+
y[idx] = y[idx, ::-1]
|
102 |
+
if np.random.uniform() < 0.02:
|
103 |
+
# mono
|
104 |
+
X[idx] = X[idx].mean(axis=0, keepdims=True)
|
105 |
+
y[idx] = y[idx].mean(axis=0, keepdims=True)
|
106 |
+
if np.random.uniform() < 0.02:
|
107 |
+
# inst
|
108 |
+
X[idx] = y[idx]
|
109 |
+
|
110 |
+
if np.random.uniform() < mixup_rate and i < len(perm) - 1:
|
111 |
+
lam = np.random.beta(mixup_alpha, mixup_alpha)
|
112 |
+
X[idx] = lam * X[idx] + (1 - lam) * X[perm[i + 1]]
|
113 |
+
y[idx] = lam * y[idx] + (1 - lam) * y[perm[i + 1]]
|
114 |
+
|
115 |
+
return X, y
|
116 |
+
|
117 |
+
|
118 |
+
def make_padding(width, cropsize, offset):
|
119 |
+
left = offset
|
120 |
+
roi_size = cropsize - left * 2
|
121 |
+
if roi_size == 0:
|
122 |
+
roi_size = cropsize
|
123 |
+
right = roi_size - (width % roi_size) + left
|
124 |
+
|
125 |
+
return left, right, roi_size
|
126 |
+
|
127 |
+
|
128 |
+
def make_training_set(filelist, cropsize, patches, sr, hop_length, n_fft, offset):
|
129 |
+
len_dataset = patches * len(filelist)
|
130 |
+
|
131 |
+
X_dataset = np.zeros((len_dataset, 2, n_fft // 2 + 1, cropsize), dtype=np.complex64)
|
132 |
+
y_dataset = np.zeros((len_dataset, 2, n_fft // 2 + 1, cropsize), dtype=np.complex64)
|
133 |
+
|
134 |
+
for i, (X_path, y_path) in enumerate(tqdm(filelist)):
|
135 |
+
X, y = spec_utils.cache_or_load(X_path, y_path, sr, hop_length, n_fft)
|
136 |
+
coef = np.max([np.abs(X).max(), np.abs(y).max()])
|
137 |
+
X, y = X / coef, y / coef
|
138 |
+
|
139 |
+
l, r, roi_size = make_padding(X.shape[2], cropsize, offset)
|
140 |
+
X_pad = np.pad(X, ((0, 0), (0, 0), (l, r)), mode="constant")
|
141 |
+
y_pad = np.pad(y, ((0, 0), (0, 0), (l, r)), mode="constant")
|
142 |
+
|
143 |
+
starts = np.random.randint(0, X_pad.shape[2] - cropsize, patches)
|
144 |
+
ends = starts + cropsize
|
145 |
+
for j in range(patches):
|
146 |
+
idx = i * patches + j
|
147 |
+
X_dataset[idx] = X_pad[:, :, starts[j] : ends[j]]
|
148 |
+
y_dataset[idx] = y_pad[:, :, starts[j] : ends[j]]
|
149 |
+
|
150 |
+
return X_dataset, y_dataset
|
151 |
+
|
152 |
+
|
153 |
+
def make_validation_set(filelist, cropsize, sr, hop_length, n_fft, offset):
|
154 |
+
patch_list = []
|
155 |
+
patch_dir = "cs{}_sr{}_hl{}_nf{}_of{}".format(
|
156 |
+
cropsize, sr, hop_length, n_fft, offset
|
157 |
+
)
|
158 |
+
os.makedirs(patch_dir, exist_ok=True)
|
159 |
+
|
160 |
+
for i, (X_path, y_path) in enumerate(tqdm(filelist)):
|
161 |
+
basename = os.path.splitext(os.path.basename(X_path))[0]
|
162 |
+
|
163 |
+
X, y = spec_utils.cache_or_load(X_path, y_path, sr, hop_length, n_fft)
|
164 |
+
coef = np.max([np.abs(X).max(), np.abs(y).max()])
|
165 |
+
X, y = X / coef, y / coef
|
166 |
+
|
167 |
+
l, r, roi_size = make_padding(X.shape[2], cropsize, offset)
|
168 |
+
X_pad = np.pad(X, ((0, 0), (0, 0), (l, r)), mode="constant")
|
169 |
+
y_pad = np.pad(y, ((0, 0), (0, 0), (l, r)), mode="constant")
|
170 |
+
|
171 |
+
len_dataset = int(np.ceil(X.shape[2] / roi_size))
|
172 |
+
for j in range(len_dataset):
|
173 |
+
outpath = os.path.join(patch_dir, "{}_p{}.npz".format(basename, j))
|
174 |
+
start = j * roi_size
|
175 |
+
if not os.path.exists(outpath):
|
176 |
+
np.savez(
|
177 |
+
outpath,
|
178 |
+
X=X_pad[:, :, start : start + cropsize],
|
179 |
+
y=y_pad[:, :, start : start + cropsize],
|
180 |
+
)
|
181 |
+
patch_list.append(outpath)
|
182 |
+
|
183 |
+
return VocalRemoverValidationSet(patch_list)
|
uvr5_pack/lib_v5/layers.py
ADDED
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import torch
|
2 |
+
from torch import nn
|
3 |
+
import torch.nn.functional as F
|
4 |
+
|
5 |
+
from uvr5_pack.lib_v5 import spec_utils
|
6 |
+
|
7 |
+
|
8 |
+
class Conv2DBNActiv(nn.Module):
|
9 |
+
def __init__(self, nin, nout, ksize=3, stride=1, pad=1, dilation=1, activ=nn.ReLU):
|
10 |
+
super(Conv2DBNActiv, self).__init__()
|
11 |
+
self.conv = nn.Sequential(
|
12 |
+
nn.Conv2d(
|
13 |
+
nin,
|
14 |
+
nout,
|
15 |
+
kernel_size=ksize,
|
16 |
+
stride=stride,
|
17 |
+
padding=pad,
|
18 |
+
dilation=dilation,
|
19 |
+
bias=False,
|
20 |
+
),
|
21 |
+
nn.BatchNorm2d(nout),
|
22 |
+
activ(),
|
23 |
+
)
|
24 |
+
|
25 |
+
def __call__(self, x):
|
26 |
+
return self.conv(x)
|
27 |
+
|
28 |
+
|
29 |
+
class SeperableConv2DBNActiv(nn.Module):
|
30 |
+
def __init__(self, nin, nout, ksize=3, stride=1, pad=1, dilation=1, activ=nn.ReLU):
|
31 |
+
super(SeperableConv2DBNActiv, self).__init__()
|
32 |
+
self.conv = nn.Sequential(
|
33 |
+
nn.Conv2d(
|
34 |
+
nin,
|
35 |
+
nin,
|
36 |
+
kernel_size=ksize,
|
37 |
+
stride=stride,
|
38 |
+
padding=pad,
|
39 |
+
dilation=dilation,
|
40 |
+
groups=nin,
|
41 |
+
bias=False,
|
42 |
+
),
|
43 |
+
nn.Conv2d(nin, nout, kernel_size=1, bias=False),
|
44 |
+
nn.BatchNorm2d(nout),
|
45 |
+
activ(),
|
46 |
+
)
|
47 |
+
|
48 |
+
def __call__(self, x):
|
49 |
+
return self.conv(x)
|
50 |
+
|
51 |
+
|
52 |
+
class Encoder(nn.Module):
|
53 |
+
def __init__(self, nin, nout, ksize=3, stride=1, pad=1, activ=nn.LeakyReLU):
|
54 |
+
super(Encoder, self).__init__()
|
55 |
+
self.conv1 = Conv2DBNActiv(nin, nout, ksize, 1, pad, activ=activ)
|
56 |
+
self.conv2 = Conv2DBNActiv(nout, nout, ksize, stride, pad, activ=activ)
|
57 |
+
|
58 |
+
def __call__(self, x):
|
59 |
+
skip = self.conv1(x)
|
60 |
+
h = self.conv2(skip)
|
61 |
+
|
62 |
+
return h, skip
|
63 |
+
|
64 |
+
|
65 |
+
class Decoder(nn.Module):
|
66 |
+
def __init__(
|
67 |
+
self, nin, nout, ksize=3, stride=1, pad=1, activ=nn.ReLU, dropout=False
|
68 |
+
):
|
69 |
+
super(Decoder, self).__init__()
|
70 |
+
self.conv = Conv2DBNActiv(nin, nout, ksize, 1, pad, activ=activ)
|
71 |
+
self.dropout = nn.Dropout2d(0.1) if dropout else None
|
72 |
+
|
73 |
+
def __call__(self, x, skip=None):
|
74 |
+
x = F.interpolate(x, scale_factor=2, mode="bilinear", align_corners=True)
|
75 |
+
if skip is not None:
|
76 |
+
skip = spec_utils.crop_center(skip, x)
|
77 |
+
x = torch.cat([x, skip], dim=1)
|
78 |
+
h = self.conv(x)
|
79 |
+
|
80 |
+
if self.dropout is not None:
|
81 |
+
h = self.dropout(h)
|
82 |
+
|
83 |
+
return h
|
84 |
+
|
85 |
+
|
86 |
+
class ASPPModule(nn.Module):
|
87 |
+
def __init__(self, nin, nout, dilations=(4, 8, 16), activ=nn.ReLU):
|
88 |
+
super(ASPPModule, self).__init__()
|
89 |
+
self.conv1 = nn.Sequential(
|
90 |
+
nn.AdaptiveAvgPool2d((1, None)),
|
91 |
+
Conv2DBNActiv(nin, nin, 1, 1, 0, activ=activ),
|
92 |
+
)
|
93 |
+
self.conv2 = Conv2DBNActiv(nin, nin, 1, 1, 0, activ=activ)
|
94 |
+
self.conv3 = SeperableConv2DBNActiv(
|
95 |
+
nin, nin, 3, 1, dilations[0], dilations[0], activ=activ
|
96 |
+
)
|
97 |
+
self.conv4 = SeperableConv2DBNActiv(
|
98 |
+
nin, nin, 3, 1, dilations[1], dilations[1], activ=activ
|
99 |
+
)
|
100 |
+
self.conv5 = SeperableConv2DBNActiv(
|
101 |
+
nin, nin, 3, 1, dilations[2], dilations[2], activ=activ
|
102 |
+
)
|
103 |
+
self.bottleneck = nn.Sequential(
|
104 |
+
Conv2DBNActiv(nin * 5, nout, 1, 1, 0, activ=activ), nn.Dropout2d(0.1)
|
105 |
+
)
|
106 |
+
|
107 |
+
def forward(self, x):
|
108 |
+
_, _, h, w = x.size()
|
109 |
+
feat1 = F.interpolate(
|
110 |
+
self.conv1(x), size=(h, w), mode="bilinear", align_corners=True
|
111 |
+
)
|
112 |
+
feat2 = self.conv2(x)
|
113 |
+
feat3 = self.conv3(x)
|
114 |
+
feat4 = self.conv4(x)
|
115 |
+
feat5 = self.conv5(x)
|
116 |
+
out = torch.cat((feat1, feat2, feat3, feat4, feat5), dim=1)
|
117 |
+
bottle = self.bottleneck(out)
|
118 |
+
return bottle
|
uvr5_pack/lib_v5/layers_123812KB .py
ADDED
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import torch
|
2 |
+
from torch import nn
|
3 |
+
import torch.nn.functional as F
|
4 |
+
|
5 |
+
from uvr5_pack.lib_v5 import spec_utils
|
6 |
+
|
7 |
+
|
8 |
+
class Conv2DBNActiv(nn.Module):
|
9 |
+
def __init__(self, nin, nout, ksize=3, stride=1, pad=1, dilation=1, activ=nn.ReLU):
|
10 |
+
super(Conv2DBNActiv, self).__init__()
|
11 |
+
self.conv = nn.Sequential(
|
12 |
+
nn.Conv2d(
|
13 |
+
nin,
|
14 |
+
nout,
|
15 |
+
kernel_size=ksize,
|
16 |
+
stride=stride,
|
17 |
+
padding=pad,
|
18 |
+
dilation=dilation,
|
19 |
+
bias=False,
|
20 |
+
),
|
21 |
+
nn.BatchNorm2d(nout),
|
22 |
+
activ(),
|
23 |
+
)
|
24 |
+
|
25 |
+
def __call__(self, x):
|
26 |
+
return self.conv(x)
|
27 |
+
|
28 |
+
|
29 |
+
class SeperableConv2DBNActiv(nn.Module):
|
30 |
+
def __init__(self, nin, nout, ksize=3, stride=1, pad=1, dilation=1, activ=nn.ReLU):
|
31 |
+
super(SeperableConv2DBNActiv, self).__init__()
|
32 |
+
self.conv = nn.Sequential(
|
33 |
+
nn.Conv2d(
|
34 |
+
nin,
|
35 |
+
nin,
|
36 |
+
kernel_size=ksize,
|
37 |
+
stride=stride,
|
38 |
+
padding=pad,
|
39 |
+
dilation=dilation,
|
40 |
+
groups=nin,
|
41 |
+
bias=False,
|
42 |
+
),
|
43 |
+
nn.Conv2d(nin, nout, kernel_size=1, bias=False),
|
44 |
+
nn.BatchNorm2d(nout),
|
45 |
+
activ(),
|
46 |
+
)
|
47 |
+
|
48 |
+
def __call__(self, x):
|
49 |
+
return self.conv(x)
|
50 |
+
|
51 |
+
|
52 |
+
class Encoder(nn.Module):
|
53 |
+
def __init__(self, nin, nout, ksize=3, stride=1, pad=1, activ=nn.LeakyReLU):
|
54 |
+
super(Encoder, self).__init__()
|
55 |
+
self.conv1 = Conv2DBNActiv(nin, nout, ksize, 1, pad, activ=activ)
|
56 |
+
self.conv2 = Conv2DBNActiv(nout, nout, ksize, stride, pad, activ=activ)
|
57 |
+
|
58 |
+
def __call__(self, x):
|
59 |
+
skip = self.conv1(x)
|
60 |
+
h = self.conv2(skip)
|
61 |
+
|
62 |
+
return h, skip
|
63 |
+
|
64 |
+
|
65 |
+
class Decoder(nn.Module):
|
66 |
+
def __init__(
|
67 |
+
self, nin, nout, ksize=3, stride=1, pad=1, activ=nn.ReLU, dropout=False
|
68 |
+
):
|
69 |
+
super(Decoder, self).__init__()
|
70 |
+
self.conv = Conv2DBNActiv(nin, nout, ksize, 1, pad, activ=activ)
|
71 |
+
self.dropout = nn.Dropout2d(0.1) if dropout else None
|
72 |
+
|
73 |
+
def __call__(self, x, skip=None):
|
74 |
+
x = F.interpolate(x, scale_factor=2, mode="bilinear", align_corners=True)
|
75 |
+
if skip is not None:
|
76 |
+
skip = spec_utils.crop_center(skip, x)
|
77 |
+
x = torch.cat([x, skip], dim=1)
|
78 |
+
h = self.conv(x)
|
79 |
+
|
80 |
+
if self.dropout is not None:
|
81 |
+
h = self.dropout(h)
|
82 |
+
|
83 |
+
return h
|
84 |
+
|
85 |
+
|
86 |
+
class ASPPModule(nn.Module):
|
87 |
+
def __init__(self, nin, nout, dilations=(4, 8, 16), activ=nn.ReLU):
|
88 |
+
super(ASPPModule, self).__init__()
|
89 |
+
self.conv1 = nn.Sequential(
|
90 |
+
nn.AdaptiveAvgPool2d((1, None)),
|
91 |
+
Conv2DBNActiv(nin, nin, 1, 1, 0, activ=activ),
|
92 |
+
)
|
93 |
+
self.conv2 = Conv2DBNActiv(nin, nin, 1, 1, 0, activ=activ)
|
94 |
+
self.conv3 = SeperableConv2DBNActiv(
|
95 |
+
nin, nin, 3, 1, dilations[0], dilations[0], activ=activ
|
96 |
+
)
|
97 |
+
self.conv4 = SeperableConv2DBNActiv(
|
98 |
+
nin, nin, 3, 1, dilations[1], dilations[1], activ=activ
|
99 |
+
)
|
100 |
+
self.conv5 = SeperableConv2DBNActiv(
|
101 |
+
nin, nin, 3, 1, dilations[2], dilations[2], activ=activ
|
102 |
+
)
|
103 |
+
self.bottleneck = nn.Sequential(
|
104 |
+
Conv2DBNActiv(nin * 5, nout, 1, 1, 0, activ=activ), nn.Dropout2d(0.1)
|
105 |
+
)
|
106 |
+
|
107 |
+
def forward(self, x):
|
108 |
+
_, _, h, w = x.size()
|
109 |
+
feat1 = F.interpolate(
|
110 |
+
self.conv1(x), size=(h, w), mode="bilinear", align_corners=True
|
111 |
+
)
|
112 |
+
feat2 = self.conv2(x)
|
113 |
+
feat3 = self.conv3(x)
|
114 |
+
feat4 = self.conv4(x)
|
115 |
+
feat5 = self.conv5(x)
|
116 |
+
out = torch.cat((feat1, feat2, feat3, feat4, feat5), dim=1)
|
117 |
+
bottle = self.bottleneck(out)
|
118 |
+
return bottle
|
uvr5_pack/lib_v5/layers_123821KB.py
ADDED
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import torch
|
2 |
+
from torch import nn
|
3 |
+
import torch.nn.functional as F
|
4 |
+
|
5 |
+
from uvr5_pack.lib_v5 import spec_utils
|
6 |
+
|
7 |
+
|
8 |
+
class Conv2DBNActiv(nn.Module):
|
9 |
+
def __init__(self, nin, nout, ksize=3, stride=1, pad=1, dilation=1, activ=nn.ReLU):
|
10 |
+
super(Conv2DBNActiv, self).__init__()
|
11 |
+
self.conv = nn.Sequential(
|
12 |
+
nn.Conv2d(
|
13 |
+
nin,
|
14 |
+
nout,
|
15 |
+
kernel_size=ksize,
|
16 |
+
stride=stride,
|
17 |
+
padding=pad,
|
18 |
+
dilation=dilation,
|
19 |
+
bias=False,
|
20 |
+
),
|
21 |
+
nn.BatchNorm2d(nout),
|
22 |
+
activ(),
|
23 |
+
)
|
24 |
+
|
25 |
+
def __call__(self, x):
|
26 |
+
return self.conv(x)
|
27 |
+
|
28 |
+
|
29 |
+
class SeperableConv2DBNActiv(nn.Module):
|
30 |
+
def __init__(self, nin, nout, ksize=3, stride=1, pad=1, dilation=1, activ=nn.ReLU):
|
31 |
+
super(SeperableConv2DBNActiv, self).__init__()
|
32 |
+
self.conv = nn.Sequential(
|
33 |
+
nn.Conv2d(
|
34 |
+
nin,
|
35 |
+
nin,
|
36 |
+
kernel_size=ksize,
|
37 |
+
stride=stride,
|
38 |
+
padding=pad,
|
39 |
+
dilation=dilation,
|
40 |
+
groups=nin,
|
41 |
+
bias=False,
|
42 |
+
),
|
43 |
+
nn.Conv2d(nin, nout, kernel_size=1, bias=False),
|
44 |
+
nn.BatchNorm2d(nout),
|
45 |
+
activ(),
|
46 |
+
)
|
47 |
+
|
48 |
+
def __call__(self, x):
|
49 |
+
return self.conv(x)
|
50 |
+
|
51 |
+
|
52 |
+
class Encoder(nn.Module):
|
53 |
+
def __init__(self, nin, nout, ksize=3, stride=1, pad=1, activ=nn.LeakyReLU):
|
54 |
+
super(Encoder, self).__init__()
|
55 |
+
self.conv1 = Conv2DBNActiv(nin, nout, ksize, 1, pad, activ=activ)
|
56 |
+
self.conv2 = Conv2DBNActiv(nout, nout, ksize, stride, pad, activ=activ)
|
57 |
+
|
58 |
+
def __call__(self, x):
|
59 |
+
skip = self.conv1(x)
|
60 |
+
h = self.conv2(skip)
|
61 |
+
|
62 |
+
return h, skip
|
63 |
+
|
64 |
+
|
65 |
+
class Decoder(nn.Module):
|
66 |
+
def __init__(
|
67 |
+
self, nin, nout, ksize=3, stride=1, pad=1, activ=nn.ReLU, dropout=False
|
68 |
+
):
|
69 |
+
super(Decoder, self).__init__()
|
70 |
+
self.conv = Conv2DBNActiv(nin, nout, ksize, 1, pad, activ=activ)
|
71 |
+
self.dropout = nn.Dropout2d(0.1) if dropout else None
|
72 |
+
|
73 |
+
def __call__(self, x, skip=None):
|
74 |
+
x = F.interpolate(x, scale_factor=2, mode="bilinear", align_corners=True)
|
75 |
+
if skip is not None:
|
76 |
+
skip = spec_utils.crop_center(skip, x)
|
77 |
+
x = torch.cat([x, skip], dim=1)
|
78 |
+
h = self.conv(x)
|
79 |
+
|
80 |
+
if self.dropout is not None:
|
81 |
+
h = self.dropout(h)
|
82 |
+
|
83 |
+
return h
|
84 |
+
|
85 |
+
|
86 |
+
class ASPPModule(nn.Module):
|
87 |
+
def __init__(self, nin, nout, dilations=(4, 8, 16), activ=nn.ReLU):
|
88 |
+
super(ASPPModule, self).__init__()
|
89 |
+
self.conv1 = nn.Sequential(
|
90 |
+
nn.AdaptiveAvgPool2d((1, None)),
|
91 |
+
Conv2DBNActiv(nin, nin, 1, 1, 0, activ=activ),
|
92 |
+
)
|
93 |
+
self.conv2 = Conv2DBNActiv(nin, nin, 1, 1, 0, activ=activ)
|
94 |
+
self.conv3 = SeperableConv2DBNActiv(
|
95 |
+
nin, nin, 3, 1, dilations[0], dilations[0], activ=activ
|
96 |
+
)
|
97 |
+
self.conv4 = SeperableConv2DBNActiv(
|
98 |
+
nin, nin, 3, 1, dilations[1], dilations[1], activ=activ
|
99 |
+
)
|
100 |
+
self.conv5 = SeperableConv2DBNActiv(
|
101 |
+
nin, nin, 3, 1, dilations[2], dilations[2], activ=activ
|
102 |
+
)
|
103 |
+
self.bottleneck = nn.Sequential(
|
104 |
+
Conv2DBNActiv(nin * 5, nout, 1, 1, 0, activ=activ), nn.Dropout2d(0.1)
|
105 |
+
)
|
106 |
+
|
107 |
+
def forward(self, x):
|
108 |
+
_, _, h, w = x.size()
|
109 |
+
feat1 = F.interpolate(
|
110 |
+
self.conv1(x), size=(h, w), mode="bilinear", align_corners=True
|
111 |
+
)
|
112 |
+
feat2 = self.conv2(x)
|
113 |
+
feat3 = self.conv3(x)
|
114 |
+
feat4 = self.conv4(x)
|
115 |
+
feat5 = self.conv5(x)
|
116 |
+
out = torch.cat((feat1, feat2, feat3, feat4, feat5), dim=1)
|
117 |
+
bottle = self.bottleneck(out)
|
118 |
+
return bottle
|
uvr5_pack/lib_v5/layers_33966KB.py
ADDED
@@ -0,0 +1,126 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import torch
|
2 |
+
from torch import nn
|
3 |
+
import torch.nn.functional as F
|
4 |
+
|
5 |
+
from uvr5_pack.lib_v5 import spec_utils
|
6 |
+
|
7 |
+
|
8 |
+
class Conv2DBNActiv(nn.Module):
|
9 |
+
def __init__(self, nin, nout, ksize=3, stride=1, pad=1, dilation=1, activ=nn.ReLU):
|
10 |
+
super(Conv2DBNActiv, self).__init__()
|
11 |
+
self.conv = nn.Sequential(
|
12 |
+
nn.Conv2d(
|
13 |
+
nin,
|
14 |
+
nout,
|
15 |
+
kernel_size=ksize,
|
16 |
+
stride=stride,
|
17 |
+
padding=pad,
|
18 |
+
dilation=dilation,
|
19 |
+
bias=False,
|
20 |
+
),
|
21 |
+
nn.BatchNorm2d(nout),
|
22 |
+
activ(),
|
23 |
+
)
|
24 |
+
|
25 |
+
def __call__(self, x):
|
26 |
+
return self.conv(x)
|
27 |
+
|
28 |
+
|
29 |
+
class SeperableConv2DBNActiv(nn.Module):
|
30 |
+
def __init__(self, nin, nout, ksize=3, stride=1, pad=1, dilation=1, activ=nn.ReLU):
|
31 |
+
super(SeperableConv2DBNActiv, self).__init__()
|
32 |
+
self.conv = nn.Sequential(
|
33 |
+
nn.Conv2d(
|
34 |
+
nin,
|
35 |
+
nin,
|
36 |
+
kernel_size=ksize,
|
37 |
+
stride=stride,
|
38 |
+
padding=pad,
|
39 |
+
dilation=dilation,
|
40 |
+
groups=nin,
|
41 |
+
bias=False,
|
42 |
+
),
|
43 |
+
nn.Conv2d(nin, nout, kernel_size=1, bias=False),
|
44 |
+
nn.BatchNorm2d(nout),
|
45 |
+
activ(),
|
46 |
+
)
|
47 |
+
|
48 |
+
def __call__(self, x):
|
49 |
+
return self.conv(x)
|
50 |
+
|
51 |
+
|
52 |
+
class Encoder(nn.Module):
|
53 |
+
def __init__(self, nin, nout, ksize=3, stride=1, pad=1, activ=nn.LeakyReLU):
|
54 |
+
super(Encoder, self).__init__()
|
55 |
+
self.conv1 = Conv2DBNActiv(nin, nout, ksize, 1, pad, activ=activ)
|
56 |
+
self.conv2 = Conv2DBNActiv(nout, nout, ksize, stride, pad, activ=activ)
|
57 |
+
|
58 |
+
def __call__(self, x):
|
59 |
+
skip = self.conv1(x)
|
60 |
+
h = self.conv2(skip)
|
61 |
+
|
62 |
+
return h, skip
|
63 |
+
|
64 |
+
|
65 |
+
class Decoder(nn.Module):
|
66 |
+
def __init__(
|
67 |
+
self, nin, nout, ksize=3, stride=1, pad=1, activ=nn.ReLU, dropout=False
|
68 |
+
):
|
69 |
+
super(Decoder, self).__init__()
|
70 |
+
self.conv = Conv2DBNActiv(nin, nout, ksize, 1, pad, activ=activ)
|
71 |
+
self.dropout = nn.Dropout2d(0.1) if dropout else None
|
72 |
+
|
73 |
+
def __call__(self, x, skip=None):
|
74 |
+
x = F.interpolate(x, scale_factor=2, mode="bilinear", align_corners=True)
|
75 |
+
if skip is not None:
|
76 |
+
skip = spec_utils.crop_center(skip, x)
|
77 |
+
x = torch.cat([x, skip], dim=1)
|
78 |
+
h = self.conv(x)
|
79 |
+
|
80 |
+
if self.dropout is not None:
|
81 |
+
h = self.dropout(h)
|
82 |
+
|
83 |
+
return h
|
84 |
+
|
85 |
+
|
86 |
+
class ASPPModule(nn.Module):
|
87 |
+
def __init__(self, nin, nout, dilations=(4, 8, 16, 32, 64), activ=nn.ReLU):
|
88 |
+
super(ASPPModule, self).__init__()
|
89 |
+
self.conv1 = nn.Sequential(
|
90 |
+
nn.AdaptiveAvgPool2d((1, None)),
|
91 |
+
Conv2DBNActiv(nin, nin, 1, 1, 0, activ=activ),
|
92 |
+
)
|
93 |
+
self.conv2 = Conv2DBNActiv(nin, nin, 1, 1, 0, activ=activ)
|
94 |
+
self.conv3 = SeperableConv2DBNActiv(
|
95 |
+
nin, nin, 3, 1, dilations[0], dilations[0], activ=activ
|
96 |
+
)
|
97 |
+
self.conv4 = SeperableConv2DBNActiv(
|
98 |
+
nin, nin, 3, 1, dilations[1], dilations[1], activ=activ
|
99 |
+
)
|
100 |
+
self.conv5 = SeperableConv2DBNActiv(
|
101 |
+
nin, nin, 3, 1, dilations[2], dilations[2], activ=activ
|
102 |
+
)
|
103 |
+
self.conv6 = SeperableConv2DBNActiv(
|
104 |
+
nin, nin, 3, 1, dilations[2], dilations[2], activ=activ
|
105 |
+
)
|
106 |
+
self.conv7 = SeperableConv2DBNActiv(
|
107 |
+
nin, nin, 3, 1, dilations[2], dilations[2], activ=activ
|
108 |
+
)
|
109 |
+
self.bottleneck = nn.Sequential(
|
110 |
+
Conv2DBNActiv(nin * 7, nout, 1, 1, 0, activ=activ), nn.Dropout2d(0.1)
|
111 |
+
)
|
112 |
+
|
113 |
+
def forward(self, x):
|
114 |
+
_, _, h, w = x.size()
|
115 |
+
feat1 = F.interpolate(
|
116 |
+
self.conv1(x), size=(h, w), mode="bilinear", align_corners=True
|
117 |
+
)
|
118 |
+
feat2 = self.conv2(x)
|
119 |
+
feat3 = self.conv3(x)
|
120 |
+
feat4 = self.conv4(x)
|
121 |
+
feat5 = self.conv5(x)
|
122 |
+
feat6 = self.conv6(x)
|
123 |
+
feat7 = self.conv7(x)
|
124 |
+
out = torch.cat((feat1, feat2, feat3, feat4, feat5, feat6, feat7), dim=1)
|
125 |
+
bottle = self.bottleneck(out)
|
126 |
+
return bottle
|
uvr5_pack/lib_v5/layers_537227KB.py
ADDED
@@ -0,0 +1,126 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import torch
|
2 |
+
from torch import nn
|
3 |
+
import torch.nn.functional as F
|
4 |
+
|
5 |
+
from uvr5_pack.lib_v5 import spec_utils
|
6 |
+
|
7 |
+
|
8 |
+
class Conv2DBNActiv(nn.Module):
|
9 |
+
def __init__(self, nin, nout, ksize=3, stride=1, pad=1, dilation=1, activ=nn.ReLU):
|
10 |
+
super(Conv2DBNActiv, self).__init__()
|
11 |
+
self.conv = nn.Sequential(
|
12 |
+
nn.Conv2d(
|
13 |
+
nin,
|
14 |
+
nout,
|
15 |
+
kernel_size=ksize,
|
16 |
+
stride=stride,
|
17 |
+
padding=pad,
|
18 |
+
dilation=dilation,
|
19 |
+
bias=False,
|
20 |
+
),
|
21 |
+
nn.BatchNorm2d(nout),
|
22 |
+
activ(),
|
23 |
+
)
|
24 |
+
|
25 |
+
def __call__(self, x):
|
26 |
+
return self.conv(x)
|
27 |
+
|
28 |
+
|
29 |
+
class SeperableConv2DBNActiv(nn.Module):
|
30 |
+
def __init__(self, nin, nout, ksize=3, stride=1, pad=1, dilation=1, activ=nn.ReLU):
|
31 |
+
super(SeperableConv2DBNActiv, self).__init__()
|
32 |
+
self.conv = nn.Sequential(
|
33 |
+
nn.Conv2d(
|
34 |
+
nin,
|
35 |
+
nin,
|
36 |
+
kernel_size=ksize,
|
37 |
+
stride=stride,
|
38 |
+
padding=pad,
|
39 |
+
dilation=dilation,
|
40 |
+
groups=nin,
|
41 |
+
bias=False,
|
42 |
+
),
|
43 |
+
nn.Conv2d(nin, nout, kernel_size=1, bias=False),
|
44 |
+
nn.BatchNorm2d(nout),
|
45 |
+
activ(),
|
46 |
+
)
|
47 |
+
|
48 |
+
def __call__(self, x):
|
49 |
+
return self.conv(x)
|
50 |
+
|
51 |
+
|
52 |
+
class Encoder(nn.Module):
|
53 |
+
def __init__(self, nin, nout, ksize=3, stride=1, pad=1, activ=nn.LeakyReLU):
|
54 |
+
super(Encoder, self).__init__()
|
55 |
+
self.conv1 = Conv2DBNActiv(nin, nout, ksize, 1, pad, activ=activ)
|
56 |
+
self.conv2 = Conv2DBNActiv(nout, nout, ksize, stride, pad, activ=activ)
|
57 |
+
|
58 |
+
def __call__(self, x):
|
59 |
+
skip = self.conv1(x)
|
60 |
+
h = self.conv2(skip)
|
61 |
+
|
62 |
+
return h, skip
|
63 |
+
|
64 |
+
|
65 |
+
class Decoder(nn.Module):
|
66 |
+
def __init__(
|
67 |
+
self, nin, nout, ksize=3, stride=1, pad=1, activ=nn.ReLU, dropout=False
|
68 |
+
):
|
69 |
+
super(Decoder, self).__init__()
|
70 |
+
self.conv = Conv2DBNActiv(nin, nout, ksize, 1, pad, activ=activ)
|
71 |
+
self.dropout = nn.Dropout2d(0.1) if dropout else None
|
72 |
+
|
73 |
+
def __call__(self, x, skip=None):
|
74 |
+
x = F.interpolate(x, scale_factor=2, mode="bilinear", align_corners=True)
|
75 |
+
if skip is not None:
|
76 |
+
skip = spec_utils.crop_center(skip, x)
|
77 |
+
x = torch.cat([x, skip], dim=1)
|
78 |
+
h = self.conv(x)
|
79 |
+
|
80 |
+
if self.dropout is not None:
|
81 |
+
h = self.dropout(h)
|
82 |
+
|
83 |
+
return h
|
84 |
+
|
85 |
+
|
86 |
+
class ASPPModule(nn.Module):
|
87 |
+
def __init__(self, nin, nout, dilations=(4, 8, 16, 32, 64), activ=nn.ReLU):
|
88 |
+
super(ASPPModule, self).__init__()
|
89 |
+
self.conv1 = nn.Sequential(
|
90 |
+
nn.AdaptiveAvgPool2d((1, None)),
|
91 |
+
Conv2DBNActiv(nin, nin, 1, 1, 0, activ=activ),
|
92 |
+
)
|
93 |
+
self.conv2 = Conv2DBNActiv(nin, nin, 1, 1, 0, activ=activ)
|
94 |
+
self.conv3 = SeperableConv2DBNActiv(
|
95 |
+
nin, nin, 3, 1, dilations[0], dilations[0], activ=activ
|
96 |
+
)
|
97 |
+
self.conv4 = SeperableConv2DBNActiv(
|
98 |
+
nin, nin, 3, 1, dilations[1], dilations[1], activ=activ
|
99 |
+
)
|
100 |
+
self.conv5 = SeperableConv2DBNActiv(
|
101 |
+
nin, nin, 3, 1, dilations[2], dilations[2], activ=activ
|
102 |
+
)
|
103 |
+
self.conv6 = SeperableConv2DBNActiv(
|
104 |
+
nin, nin, 3, 1, dilations[2], dilations[2], activ=activ
|
105 |
+
)
|
106 |
+
self.conv7 = SeperableConv2DBNActiv(
|
107 |
+
nin, nin, 3, 1, dilations[2], dilations[2], activ=activ
|
108 |
+
)
|
109 |
+
self.bottleneck = nn.Sequential(
|
110 |
+
Conv2DBNActiv(nin * 7, nout, 1, 1, 0, activ=activ), nn.Dropout2d(0.1)
|
111 |
+
)
|
112 |
+
|
113 |
+
def forward(self, x):
|
114 |
+
_, _, h, w = x.size()
|
115 |
+
feat1 = F.interpolate(
|
116 |
+
self.conv1(x), size=(h, w), mode="bilinear", align_corners=True
|
117 |
+
)
|
118 |
+
feat2 = self.conv2(x)
|
119 |
+
feat3 = self.conv3(x)
|
120 |
+
feat4 = self.conv4(x)
|
121 |
+
feat5 = self.conv5(x)
|
122 |
+
feat6 = self.conv6(x)
|
123 |
+
feat7 = self.conv7(x)
|
124 |
+
out = torch.cat((feat1, feat2, feat3, feat4, feat5, feat6, feat7), dim=1)
|
125 |
+
bottle = self.bottleneck(out)
|
126 |
+
return bottle
|
uvr5_pack/lib_v5/layers_537238KB.py
ADDED
@@ -0,0 +1,126 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import torch
|
2 |
+
from torch import nn
|
3 |
+
import torch.nn.functional as F
|
4 |
+
|
5 |
+
from uvr5_pack.lib_v5 import spec_utils
|
6 |
+
|
7 |
+
|
8 |
+
class Conv2DBNActiv(nn.Module):
|
9 |
+
def __init__(self, nin, nout, ksize=3, stride=1, pad=1, dilation=1, activ=nn.ReLU):
|
10 |
+
super(Conv2DBNActiv, self).__init__()
|
11 |
+
self.conv = nn.Sequential(
|
12 |
+
nn.Conv2d(
|
13 |
+
nin,
|
14 |
+
nout,
|
15 |
+
kernel_size=ksize,
|
16 |
+
stride=stride,
|
17 |
+
padding=pad,
|
18 |
+
dilation=dilation,
|
19 |
+
bias=False,
|
20 |
+
),
|
21 |
+
nn.BatchNorm2d(nout),
|
22 |
+
activ(),
|
23 |
+
)
|
24 |
+
|
25 |
+
def __call__(self, x):
|
26 |
+
return self.conv(x)
|
27 |
+
|
28 |
+
|
29 |
+
class SeperableConv2DBNActiv(nn.Module):
|
30 |
+
def __init__(self, nin, nout, ksize=3, stride=1, pad=1, dilation=1, activ=nn.ReLU):
|
31 |
+
super(SeperableConv2DBNActiv, self).__init__()
|
32 |
+
self.conv = nn.Sequential(
|
33 |
+
nn.Conv2d(
|
34 |
+
nin,
|
35 |
+
nin,
|
36 |
+
kernel_size=ksize,
|
37 |
+
stride=stride,
|
38 |
+
padding=pad,
|
39 |
+
dilation=dilation,
|
40 |
+
groups=nin,
|
41 |
+
bias=False,
|
42 |
+
),
|
43 |
+
nn.Conv2d(nin, nout, kernel_size=1, bias=False),
|
44 |
+
nn.BatchNorm2d(nout),
|
45 |
+
activ(),
|
46 |
+
)
|
47 |
+
|
48 |
+
def __call__(self, x):
|
49 |
+
return self.conv(x)
|
50 |
+
|
51 |
+
|
52 |
+
class Encoder(nn.Module):
|
53 |
+
def __init__(self, nin, nout, ksize=3, stride=1, pad=1, activ=nn.LeakyReLU):
|
54 |
+
super(Encoder, self).__init__()
|
55 |
+
self.conv1 = Conv2DBNActiv(nin, nout, ksize, 1, pad, activ=activ)
|
56 |
+
self.conv2 = Conv2DBNActiv(nout, nout, ksize, stride, pad, activ=activ)
|
57 |
+
|
58 |
+
def __call__(self, x):
|
59 |
+
skip = self.conv1(x)
|
60 |
+
h = self.conv2(skip)
|
61 |
+
|
62 |
+
return h, skip
|
63 |
+
|
64 |
+
|
65 |
+
class Decoder(nn.Module):
|
66 |
+
def __init__(
|
67 |
+
self, nin, nout, ksize=3, stride=1, pad=1, activ=nn.ReLU, dropout=False
|
68 |
+
):
|
69 |
+
super(Decoder, self).__init__()
|
70 |
+
self.conv = Conv2DBNActiv(nin, nout, ksize, 1, pad, activ=activ)
|
71 |
+
self.dropout = nn.Dropout2d(0.1) if dropout else None
|
72 |
+
|
73 |
+
def __call__(self, x, skip=None):
|
74 |
+
x = F.interpolate(x, scale_factor=2, mode="bilinear", align_corners=True)
|
75 |
+
if skip is not None:
|
76 |
+
skip = spec_utils.crop_center(skip, x)
|
77 |
+
x = torch.cat([x, skip], dim=1)
|
78 |
+
h = self.conv(x)
|
79 |
+
|
80 |
+
if self.dropout is not None:
|
81 |
+
h = self.dropout(h)
|
82 |
+
|
83 |
+
return h
|
84 |
+
|
85 |
+
|
86 |
+
class ASPPModule(nn.Module):
|
87 |
+
def __init__(self, nin, nout, dilations=(4, 8, 16, 32, 64), activ=nn.ReLU):
|
88 |
+
super(ASPPModule, self).__init__()
|
89 |
+
self.conv1 = nn.Sequential(
|
90 |
+
nn.AdaptiveAvgPool2d((1, None)),
|
91 |
+
Conv2DBNActiv(nin, nin, 1, 1, 0, activ=activ),
|
92 |
+
)
|
93 |
+
self.conv2 = Conv2DBNActiv(nin, nin, 1, 1, 0, activ=activ)
|
94 |
+
self.conv3 = SeperableConv2DBNActiv(
|
95 |
+
nin, nin, 3, 1, dilations[0], dilations[0], activ=activ
|
96 |
+
)
|
97 |
+
self.conv4 = SeperableConv2DBNActiv(
|
98 |
+
nin, nin, 3, 1, dilations[1], dilations[1], activ=activ
|
99 |
+
)
|
100 |
+
self.conv5 = SeperableConv2DBNActiv(
|
101 |
+
nin, nin, 3, 1, dilations[2], dilations[2], activ=activ
|
102 |
+
)
|
103 |
+
self.conv6 = SeperableConv2DBNActiv(
|
104 |
+
nin, nin, 3, 1, dilations[2], dilations[2], activ=activ
|
105 |
+
)
|
106 |
+
self.conv7 = SeperableConv2DBNActiv(
|
107 |
+
nin, nin, 3, 1, dilations[2], dilations[2], activ=activ
|
108 |
+
)
|
109 |
+
self.bottleneck = nn.Sequential(
|
110 |
+
Conv2DBNActiv(nin * 7, nout, 1, 1, 0, activ=activ), nn.Dropout2d(0.1)
|
111 |
+
)
|
112 |
+
|
113 |
+
def forward(self, x):
|
114 |
+
_, _, h, w = x.size()
|
115 |
+
feat1 = F.interpolate(
|
116 |
+
self.conv1(x), size=(h, w), mode="bilinear", align_corners=True
|
117 |
+
)
|
118 |
+
feat2 = self.conv2(x)
|
119 |
+
feat3 = self.conv3(x)
|
120 |
+
feat4 = self.conv4(x)
|
121 |
+
feat5 = self.conv5(x)
|
122 |
+
feat6 = self.conv6(x)
|
123 |
+
feat7 = self.conv7(x)
|
124 |
+
out = torch.cat((feat1, feat2, feat3, feat4, feat5, feat6, feat7), dim=1)
|
125 |
+
bottle = self.bottleneck(out)
|
126 |
+
return bottle
|
uvr5_pack/lib_v5/layers_new.py
ADDED
@@ -0,0 +1,126 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import torch
|
2 |
+
from torch import nn
|
3 |
+
import torch.nn.functional as F
|
4 |
+
|
5 |
+
from uvr5_pack.lib_v5 import spec_utils
|
6 |
+
|
7 |
+
class Conv2DBNActiv(nn.Module):
|
8 |
+
|
9 |
+
def __init__(self, nin, nout, ksize=3, stride=1, pad=1, dilation=1, activ=nn.ReLU):
|
10 |
+
super(Conv2DBNActiv, self).__init__()
|
11 |
+
self.conv = nn.Sequential(
|
12 |
+
nn.Conv2d(
|
13 |
+
nin, nout,
|
14 |
+
kernel_size=ksize,
|
15 |
+
stride=stride,
|
16 |
+
padding=pad,
|
17 |
+
dilation=dilation,
|
18 |
+
bias=False),
|
19 |
+
nn.BatchNorm2d(nout),
|
20 |
+
activ()
|
21 |
+
)
|
22 |
+
|
23 |
+
def __call__(self, x):
|
24 |
+
return self.conv(x)
|
25 |
+
|
26 |
+
class Encoder(nn.Module):
|
27 |
+
|
28 |
+
def __init__(self, nin, nout, ksize=3, stride=1, pad=1, activ=nn.LeakyReLU):
|
29 |
+
super(Encoder, self).__init__()
|
30 |
+
self.conv1 = Conv2DBNActiv(nin, nout, ksize, stride, pad, activ=activ)
|
31 |
+
self.conv2 = Conv2DBNActiv(nout, nout, ksize, 1, pad, activ=activ)
|
32 |
+
|
33 |
+
def __call__(self, x):
|
34 |
+
h = self.conv1(x)
|
35 |
+
h = self.conv2(h)
|
36 |
+
|
37 |
+
return h
|
38 |
+
|
39 |
+
|
40 |
+
class Decoder(nn.Module):
|
41 |
+
|
42 |
+
def __init__(self, nin, nout, ksize=3, stride=1, pad=1, activ=nn.ReLU, dropout=False):
|
43 |
+
super(Decoder, self).__init__()
|
44 |
+
self.conv1 = Conv2DBNActiv(nin, nout, ksize, 1, pad, activ=activ)
|
45 |
+
# self.conv2 = Conv2DBNActiv(nout, nout, ksize, 1, pad, activ=activ)
|
46 |
+
self.dropout = nn.Dropout2d(0.1) if dropout else None
|
47 |
+
|
48 |
+
def __call__(self, x, skip=None):
|
49 |
+
x = F.interpolate(x, scale_factor=2, mode='bilinear', align_corners=True)
|
50 |
+
|
51 |
+
if skip is not None:
|
52 |
+
skip = spec_utils.crop_center(skip, x)
|
53 |
+
x = torch.cat([x, skip], dim=1)
|
54 |
+
|
55 |
+
h = self.conv1(x)
|
56 |
+
# h = self.conv2(h)
|
57 |
+
|
58 |
+
if self.dropout is not None:
|
59 |
+
h = self.dropout(h)
|
60 |
+
|
61 |
+
return h
|
62 |
+
|
63 |
+
|
64 |
+
class ASPPModule(nn.Module):
|
65 |
+
|
66 |
+
def __init__(self, nin, nout, dilations=(4, 8, 12), activ=nn.ReLU, dropout=False):
|
67 |
+
super(ASPPModule, self).__init__()
|
68 |
+
self.conv1 = nn.Sequential(
|
69 |
+
nn.AdaptiveAvgPool2d((1, None)),
|
70 |
+
Conv2DBNActiv(nin, nout, 1, 1, 0, activ=activ)
|
71 |
+
)
|
72 |
+
self.conv2 = Conv2DBNActiv(nin, nout, 1, 1, 0, activ=activ)
|
73 |
+
self.conv3 = Conv2DBNActiv(
|
74 |
+
nin, nout, 3, 1, dilations[0], dilations[0], activ=activ
|
75 |
+
)
|
76 |
+
self.conv4 = Conv2DBNActiv(
|
77 |
+
nin, nout, 3, 1, dilations[1], dilations[1], activ=activ
|
78 |
+
)
|
79 |
+
self.conv5 = Conv2DBNActiv(
|
80 |
+
nin, nout, 3, 1, dilations[2], dilations[2], activ=activ
|
81 |
+
)
|
82 |
+
self.bottleneck = Conv2DBNActiv(nout * 5, nout, 1, 1, 0, activ=activ)
|
83 |
+
self.dropout = nn.Dropout2d(0.1) if dropout else None
|
84 |
+
|
85 |
+
def forward(self, x):
|
86 |
+
_, _, h, w = x.size()
|
87 |
+
feat1 = F.interpolate(self.conv1(x), size=(h, w), mode='bilinear', align_corners=True)
|
88 |
+
feat2 = self.conv2(x)
|
89 |
+
feat3 = self.conv3(x)
|
90 |
+
feat4 = self.conv4(x)
|
91 |
+
feat5 = self.conv5(x)
|
92 |
+
out = torch.cat((feat1, feat2, feat3, feat4, feat5), dim=1)
|
93 |
+
out = self.bottleneck(out)
|
94 |
+
|
95 |
+
if self.dropout is not None:
|
96 |
+
out = self.dropout(out)
|
97 |
+
|
98 |
+
return out
|
99 |
+
|
100 |
+
|
101 |
+
class LSTMModule(nn.Module):
|
102 |
+
|
103 |
+
def __init__(self, nin_conv, nin_lstm, nout_lstm):
|
104 |
+
super(LSTMModule, self).__init__()
|
105 |
+
self.conv = Conv2DBNActiv(nin_conv, 1, 1, 1, 0)
|
106 |
+
self.lstm = nn.LSTM(
|
107 |
+
input_size=nin_lstm,
|
108 |
+
hidden_size=nout_lstm // 2,
|
109 |
+
bidirectional=True
|
110 |
+
)
|
111 |
+
self.dense = nn.Sequential(
|
112 |
+
nn.Linear(nout_lstm, nin_lstm),
|
113 |
+
nn.BatchNorm1d(nin_lstm),
|
114 |
+
nn.ReLU()
|
115 |
+
)
|
116 |
+
|
117 |
+
def forward(self, x):
|
118 |
+
N, _, nbins, nframes = x.size()
|
119 |
+
h = self.conv(x)[:, 0] # N, nbins, nframes
|
120 |
+
h = h.permute(2, 0, 1) # nframes, N, nbins
|
121 |
+
h, _ = self.lstm(h)
|
122 |
+
h = self.dense(h.reshape(-1, h.size()[-1])) # nframes * N, nbins
|
123 |
+
h = h.reshape(nframes, N, 1, nbins)
|
124 |
+
h = h.permute(1, 2, 3, 0)
|
125 |
+
|
126 |
+
return h
|
uvr5_pack/lib_v5/model_param_init.py
ADDED
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import json
|
2 |
+
import os
|
3 |
+
import pathlib
|
4 |
+
|
5 |
+
default_param = {}
|
6 |
+
default_param["bins"] = 768
|
7 |
+
default_param["unstable_bins"] = 9 # training only
|
8 |
+
default_param["reduction_bins"] = 762 # training only
|
9 |
+
default_param["sr"] = 44100
|
10 |
+
default_param["pre_filter_start"] = 757
|
11 |
+
default_param["pre_filter_stop"] = 768
|
12 |
+
default_param["band"] = {}
|
13 |
+
|
14 |
+
|
15 |
+
default_param["band"][1] = {
|
16 |
+
"sr": 11025,
|
17 |
+
"hl": 128,
|
18 |
+
"n_fft": 960,
|
19 |
+
"crop_start": 0,
|
20 |
+
"crop_stop": 245,
|
21 |
+
"lpf_start": 61, # inference only
|
22 |
+
"res_type": "polyphase",
|
23 |
+
}
|
24 |
+
|
25 |
+
default_param["band"][2] = {
|
26 |
+
"sr": 44100,
|
27 |
+
"hl": 512,
|
28 |
+
"n_fft": 1536,
|
29 |
+
"crop_start": 24,
|
30 |
+
"crop_stop": 547,
|
31 |
+
"hpf_start": 81, # inference only
|
32 |
+
"res_type": "sinc_best",
|
33 |
+
}
|
34 |
+
|
35 |
+
|
36 |
+
def int_keys(d):
|
37 |
+
r = {}
|
38 |
+
for k, v in d:
|
39 |
+
if k.isdigit():
|
40 |
+
k = int(k)
|
41 |
+
r[k] = v
|
42 |
+
return r
|
43 |
+
|
44 |
+
|
45 |
+
class ModelParameters(object):
|
46 |
+
def __init__(self, config_path=""):
|
47 |
+
if ".pth" == pathlib.Path(config_path).suffix:
|
48 |
+
import zipfile
|
49 |
+
|
50 |
+
with zipfile.ZipFile(config_path, "r") as zip:
|
51 |
+
self.param = json.loads(
|
52 |
+
zip.read("param.json"), object_pairs_hook=int_keys
|
53 |
+
)
|
54 |
+
elif ".json" == pathlib.Path(config_path).suffix:
|
55 |
+
with open(config_path, "r") as f:
|
56 |
+
self.param = json.loads(f.read(), object_pairs_hook=int_keys)
|
57 |
+
else:
|
58 |
+
self.param = default_param
|
59 |
+
|
60 |
+
for k in [
|
61 |
+
"mid_side",
|
62 |
+
"mid_side_b",
|
63 |
+
"mid_side_b2",
|
64 |
+
"stereo_w",
|
65 |
+
"stereo_n",
|
66 |
+
"reverse",
|
67 |
+
]:
|
68 |
+
if not k in self.param:
|
69 |
+
self.param[k] = False
|
uvr5_pack/lib_v5/modelparams/1band_sr16000_hl512.json
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bins": 1024,
|
3 |
+
"unstable_bins": 0,
|
4 |
+
"reduction_bins": 0,
|
5 |
+
"band": {
|
6 |
+
"1": {
|
7 |
+
"sr": 16000,
|
8 |
+
"hl": 512,
|
9 |
+
"n_fft": 2048,
|
10 |
+
"crop_start": 0,
|
11 |
+
"crop_stop": 1024,
|
12 |
+
"hpf_start": -1,
|
13 |
+
"res_type": "sinc_best"
|
14 |
+
}
|
15 |
+
},
|
16 |
+
"sr": 16000,
|
17 |
+
"pre_filter_start": 1023,
|
18 |
+
"pre_filter_stop": 1024
|
19 |
+
}
|
uvr5_pack/lib_v5/modelparams/1band_sr32000_hl512.json
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bins": 1024,
|
3 |
+
"unstable_bins": 0,
|
4 |
+
"reduction_bins": 0,
|
5 |
+
"band": {
|
6 |
+
"1": {
|
7 |
+
"sr": 32000,
|
8 |
+
"hl": 512,
|
9 |
+
"n_fft": 2048,
|
10 |
+
"crop_start": 0,
|
11 |
+
"crop_stop": 1024,
|
12 |
+
"hpf_start": -1,
|
13 |
+
"res_type": "kaiser_fast"
|
14 |
+
}
|
15 |
+
},
|
16 |
+
"sr": 32000,
|
17 |
+
"pre_filter_start": 1000,
|
18 |
+
"pre_filter_stop": 1021
|
19 |
+
}
|
uvr5_pack/lib_v5/modelparams/1band_sr33075_hl384.json
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bins": 1024,
|
3 |
+
"unstable_bins": 0,
|
4 |
+
"reduction_bins": 0,
|
5 |
+
"band": {
|
6 |
+
"1": {
|
7 |
+
"sr": 33075,
|
8 |
+
"hl": 384,
|
9 |
+
"n_fft": 2048,
|
10 |
+
"crop_start": 0,
|
11 |
+
"crop_stop": 1024,
|
12 |
+
"hpf_start": -1,
|
13 |
+
"res_type": "sinc_best"
|
14 |
+
}
|
15 |
+
},
|
16 |
+
"sr": 33075,
|
17 |
+
"pre_filter_start": 1000,
|
18 |
+
"pre_filter_stop": 1021
|
19 |
+
}
|
uvr5_pack/lib_v5/modelparams/1band_sr44100_hl1024.json
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bins": 1024,
|
3 |
+
"unstable_bins": 0,
|
4 |
+
"reduction_bins": 0,
|
5 |
+
"band": {
|
6 |
+
"1": {
|
7 |
+
"sr": 44100,
|
8 |
+
"hl": 1024,
|
9 |
+
"n_fft": 2048,
|
10 |
+
"crop_start": 0,
|
11 |
+
"crop_stop": 1024,
|
12 |
+
"hpf_start": -1,
|
13 |
+
"res_type": "sinc_best"
|
14 |
+
}
|
15 |
+
},
|
16 |
+
"sr": 44100,
|
17 |
+
"pre_filter_start": 1023,
|
18 |
+
"pre_filter_stop": 1024
|
19 |
+
}
|
uvr5_pack/lib_v5/modelparams/1band_sr44100_hl256.json
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bins": 256,
|
3 |
+
"unstable_bins": 0,
|
4 |
+
"reduction_bins": 0,
|
5 |
+
"band": {
|
6 |
+
"1": {
|
7 |
+
"sr": 44100,
|
8 |
+
"hl": 256,
|
9 |
+
"n_fft": 512,
|
10 |
+
"crop_start": 0,
|
11 |
+
"crop_stop": 256,
|
12 |
+
"hpf_start": -1,
|
13 |
+
"res_type": "sinc_best"
|
14 |
+
}
|
15 |
+
},
|
16 |
+
"sr": 44100,
|
17 |
+
"pre_filter_start": 256,
|
18 |
+
"pre_filter_stop": 256
|
19 |
+
}
|
uvr5_pack/lib_v5/modelparams/1band_sr44100_hl512.json
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bins": 1024,
|
3 |
+
"unstable_bins": 0,
|
4 |
+
"reduction_bins": 0,
|
5 |
+
"band": {
|
6 |
+
"1": {
|
7 |
+
"sr": 44100,
|
8 |
+
"hl": 512,
|
9 |
+
"n_fft": 2048,
|
10 |
+
"crop_start": 0,
|
11 |
+
"crop_stop": 1024,
|
12 |
+
"hpf_start": -1,
|
13 |
+
"res_type": "sinc_best"
|
14 |
+
}
|
15 |
+
},
|
16 |
+
"sr": 44100,
|
17 |
+
"pre_filter_start": 1023,
|
18 |
+
"pre_filter_stop": 1024
|
19 |
+
}
|
uvr5_pack/lib_v5/modelparams/1band_sr44100_hl512_cut.json
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bins": 1024,
|
3 |
+
"unstable_bins": 0,
|
4 |
+
"reduction_bins": 0,
|
5 |
+
"band": {
|
6 |
+
"1": {
|
7 |
+
"sr": 44100,
|
8 |
+
"hl": 512,
|
9 |
+
"n_fft": 2048,
|
10 |
+
"crop_start": 0,
|
11 |
+
"crop_stop": 700,
|
12 |
+
"hpf_start": -1,
|
13 |
+
"res_type": "sinc_best"
|
14 |
+
}
|
15 |
+
},
|
16 |
+
"sr": 44100,
|
17 |
+
"pre_filter_start": 1023,
|
18 |
+
"pre_filter_stop": 700
|
19 |
+
}
|
uvr5_pack/lib_v5/modelparams/2band_32000.json
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bins": 768,
|
3 |
+
"unstable_bins": 7,
|
4 |
+
"reduction_bins": 705,
|
5 |
+
"band": {
|
6 |
+
"1": {
|
7 |
+
"sr": 6000,
|
8 |
+
"hl": 66,
|
9 |
+
"n_fft": 512,
|
10 |
+
"crop_start": 0,
|
11 |
+
"crop_stop": 240,
|
12 |
+
"lpf_start": 60,
|
13 |
+
"lpf_stop": 118,
|
14 |
+
"res_type": "sinc_fastest"
|
15 |
+
},
|
16 |
+
"2": {
|
17 |
+
"sr": 32000,
|
18 |
+
"hl": 352,
|
19 |
+
"n_fft": 1024,
|
20 |
+
"crop_start": 22,
|
21 |
+
"crop_stop": 505,
|
22 |
+
"hpf_start": 44,
|
23 |
+
"hpf_stop": 23,
|
24 |
+
"res_type": "sinc_medium"
|
25 |
+
}
|
26 |
+
},
|
27 |
+
"sr": 32000,
|
28 |
+
"pre_filter_start": 710,
|
29 |
+
"pre_filter_stop": 731
|
30 |
+
}
|
uvr5_pack/lib_v5/modelparams/2band_44100_lofi.json
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bins": 512,
|
3 |
+
"unstable_bins": 7,
|
4 |
+
"reduction_bins": 510,
|
5 |
+
"band": {
|
6 |
+
"1": {
|
7 |
+
"sr": 11025,
|
8 |
+
"hl": 160,
|
9 |
+
"n_fft": 768,
|
10 |
+
"crop_start": 0,
|
11 |
+
"crop_stop": 192,
|
12 |
+
"lpf_start": 41,
|
13 |
+
"lpf_stop": 139,
|
14 |
+
"res_type": "sinc_fastest"
|
15 |
+
},
|
16 |
+
"2": {
|
17 |
+
"sr": 44100,
|
18 |
+
"hl": 640,
|
19 |
+
"n_fft": 1024,
|
20 |
+
"crop_start": 10,
|
21 |
+
"crop_stop": 320,
|
22 |
+
"hpf_start": 47,
|
23 |
+
"hpf_stop": 15,
|
24 |
+
"res_type": "sinc_medium"
|
25 |
+
}
|
26 |
+
},
|
27 |
+
"sr": 44100,
|
28 |
+
"pre_filter_start": 510,
|
29 |
+
"pre_filter_stop": 512
|
30 |
+
}
|
uvr5_pack/lib_v5/modelparams/2band_48000.json
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bins": 768,
|
3 |
+
"unstable_bins": 7,
|
4 |
+
"reduction_bins": 705,
|
5 |
+
"band": {
|
6 |
+
"1": {
|
7 |
+
"sr": 6000,
|
8 |
+
"hl": 66,
|
9 |
+
"n_fft": 512,
|
10 |
+
"crop_start": 0,
|
11 |
+
"crop_stop": 240,
|
12 |
+
"lpf_start": 60,
|
13 |
+
"lpf_stop": 240,
|
14 |
+
"res_type": "sinc_fastest"
|
15 |
+
},
|
16 |
+
"2": {
|
17 |
+
"sr": 48000,
|
18 |
+
"hl": 528,
|
19 |
+
"n_fft": 1536,
|
20 |
+
"crop_start": 22,
|
21 |
+
"crop_stop": 505,
|
22 |
+
"hpf_start": 82,
|
23 |
+
"hpf_stop": 22,
|
24 |
+
"res_type": "sinc_medium"
|
25 |
+
}
|
26 |
+
},
|
27 |
+
"sr": 48000,
|
28 |
+
"pre_filter_start": 710,
|
29 |
+
"pre_filter_stop": 731
|
30 |
+
}
|
uvr5_pack/lib_v5/modelparams/3band_44100.json
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bins": 768,
|
3 |
+
"unstable_bins": 5,
|
4 |
+
"reduction_bins": 733,
|
5 |
+
"band": {
|
6 |
+
"1": {
|
7 |
+
"sr": 11025,
|
8 |
+
"hl": 128,
|
9 |
+
"n_fft": 768,
|
10 |
+
"crop_start": 0,
|
11 |
+
"crop_stop": 278,
|
12 |
+
"lpf_start": 28,
|
13 |
+
"lpf_stop": 140,
|
14 |
+
"res_type": "polyphase"
|
15 |
+
},
|
16 |
+
"2": {
|
17 |
+
"sr": 22050,
|
18 |
+
"hl": 256,
|
19 |
+
"n_fft": 768,
|
20 |
+
"crop_start": 14,
|
21 |
+
"crop_stop": 322,
|
22 |
+
"hpf_start": 70,
|
23 |
+
"hpf_stop": 14,
|
24 |
+
"lpf_start": 283,
|
25 |
+
"lpf_stop": 314,
|
26 |
+
"res_type": "polyphase"
|
27 |
+
},
|
28 |
+
"3": {
|
29 |
+
"sr": 44100,
|
30 |
+
"hl": 512,
|
31 |
+
"n_fft": 768,
|
32 |
+
"crop_start": 131,
|
33 |
+
"crop_stop": 313,
|
34 |
+
"hpf_start": 154,
|
35 |
+
"hpf_stop": 141,
|
36 |
+
"res_type": "sinc_medium"
|
37 |
+
}
|
38 |
+
},
|
39 |
+
"sr": 44100,
|
40 |
+
"pre_filter_start": 757,
|
41 |
+
"pre_filter_stop": 768
|
42 |
+
}
|
uvr5_pack/lib_v5/modelparams/3band_44100_mid.json
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"mid_side": true,
|
3 |
+
"bins": 768,
|
4 |
+
"unstable_bins": 5,
|
5 |
+
"reduction_bins": 733,
|
6 |
+
"band": {
|
7 |
+
"1": {
|
8 |
+
"sr": 11025,
|
9 |
+
"hl": 128,
|
10 |
+
"n_fft": 768,
|
11 |
+
"crop_start": 0,
|
12 |
+
"crop_stop": 278,
|
13 |
+
"lpf_start": 28,
|
14 |
+
"lpf_stop": 140,
|
15 |
+
"res_type": "polyphase"
|
16 |
+
},
|
17 |
+
"2": {
|
18 |
+
"sr": 22050,
|
19 |
+
"hl": 256,
|
20 |
+
"n_fft": 768,
|
21 |
+
"crop_start": 14,
|
22 |
+
"crop_stop": 322,
|
23 |
+
"hpf_start": 70,
|
24 |
+
"hpf_stop": 14,
|
25 |
+
"lpf_start": 283,
|
26 |
+
"lpf_stop": 314,
|
27 |
+
"res_type": "polyphase"
|
28 |
+
},
|
29 |
+
"3": {
|
30 |
+
"sr": 44100,
|
31 |
+
"hl": 512,
|
32 |
+
"n_fft": 768,
|
33 |
+
"crop_start": 131,
|
34 |
+
"crop_stop": 313,
|
35 |
+
"hpf_start": 154,
|
36 |
+
"hpf_stop": 141,
|
37 |
+
"res_type": "sinc_medium"
|
38 |
+
}
|
39 |
+
},
|
40 |
+
"sr": 44100,
|
41 |
+
"pre_filter_start": 757,
|
42 |
+
"pre_filter_stop": 768
|
43 |
+
}
|
uvr5_pack/lib_v5/modelparams/3band_44100_msb2.json
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"mid_side_b2": true,
|
3 |
+
"bins": 640,
|
4 |
+
"unstable_bins": 7,
|
5 |
+
"reduction_bins": 565,
|
6 |
+
"band": {
|
7 |
+
"1": {
|
8 |
+
"sr": 11025,
|
9 |
+
"hl": 108,
|
10 |
+
"n_fft": 1024,
|
11 |
+
"crop_start": 0,
|
12 |
+
"crop_stop": 187,
|
13 |
+
"lpf_start": 92,
|
14 |
+
"lpf_stop": 186,
|
15 |
+
"res_type": "polyphase"
|
16 |
+
},
|
17 |
+
"2": {
|
18 |
+
"sr": 22050,
|
19 |
+
"hl": 216,
|
20 |
+
"n_fft": 768,
|
21 |
+
"crop_start": 0,
|
22 |
+
"crop_stop": 212,
|
23 |
+
"hpf_start": 68,
|
24 |
+
"hpf_stop": 34,
|
25 |
+
"lpf_start": 174,
|
26 |
+
"lpf_stop": 209,
|
27 |
+
"res_type": "polyphase"
|
28 |
+
},
|
29 |
+
"3": {
|
30 |
+
"sr": 44100,
|
31 |
+
"hl": 432,
|
32 |
+
"n_fft": 640,
|
33 |
+
"crop_start": 66,
|
34 |
+
"crop_stop": 307,
|
35 |
+
"hpf_start": 86,
|
36 |
+
"hpf_stop": 72,
|
37 |
+
"res_type": "kaiser_fast"
|
38 |
+
}
|
39 |
+
},
|
40 |
+
"sr": 44100,
|
41 |
+
"pre_filter_start": 639,
|
42 |
+
"pre_filter_stop": 640
|
43 |
+
}
|
uvr5_pack/lib_v5/modelparams/4band_44100.json
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bins": 768,
|
3 |
+
"unstable_bins": 7,
|
4 |
+
"reduction_bins": 668,
|
5 |
+
"band": {
|
6 |
+
"1": {
|
7 |
+
"sr": 11025,
|
8 |
+
"hl": 128,
|
9 |
+
"n_fft": 1024,
|
10 |
+
"crop_start": 0,
|
11 |
+
"crop_stop": 186,
|
12 |
+
"lpf_start": 37,
|
13 |
+
"lpf_stop": 73,
|
14 |
+
"res_type": "polyphase"
|
15 |
+
},
|
16 |
+
"2": {
|
17 |
+
"sr": 11025,
|
18 |
+
"hl": 128,
|
19 |
+
"n_fft": 512,
|
20 |
+
"crop_start": 4,
|
21 |
+
"crop_stop": 185,
|
22 |
+
"hpf_start": 36,
|
23 |
+
"hpf_stop": 18,
|
24 |
+
"lpf_start": 93,
|
25 |
+
"lpf_stop": 185,
|
26 |
+
"res_type": "polyphase"
|
27 |
+
},
|
28 |
+
"3": {
|
29 |
+
"sr": 22050,
|
30 |
+
"hl": 256,
|
31 |
+
"n_fft": 512,
|
32 |
+
"crop_start": 46,
|
33 |
+
"crop_stop": 186,
|
34 |
+
"hpf_start": 93,
|
35 |
+
"hpf_stop": 46,
|
36 |
+
"lpf_start": 164,
|
37 |
+
"lpf_stop": 186,
|
38 |
+
"res_type": "polyphase"
|
39 |
+
},
|
40 |
+
"4": {
|
41 |
+
"sr": 44100,
|
42 |
+
"hl": 512,
|
43 |
+
"n_fft": 768,
|
44 |
+
"crop_start": 121,
|
45 |
+
"crop_stop": 382,
|
46 |
+
"hpf_start": 138,
|
47 |
+
"hpf_stop": 123,
|
48 |
+
"res_type": "sinc_medium"
|
49 |
+
}
|
50 |
+
},
|
51 |
+
"sr": 44100,
|
52 |
+
"pre_filter_start": 740,
|
53 |
+
"pre_filter_stop": 768
|
54 |
+
}
|
uvr5_pack/lib_v5/modelparams/4band_44100_mid.json
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bins": 768,
|
3 |
+
"unstable_bins": 7,
|
4 |
+
"mid_side": true,
|
5 |
+
"reduction_bins": 668,
|
6 |
+
"band": {
|
7 |
+
"1": {
|
8 |
+
"sr": 11025,
|
9 |
+
"hl": 128,
|
10 |
+
"n_fft": 1024,
|
11 |
+
"crop_start": 0,
|
12 |
+
"crop_stop": 186,
|
13 |
+
"lpf_start": 37,
|
14 |
+
"lpf_stop": 73,
|
15 |
+
"res_type": "polyphase"
|
16 |
+
},
|
17 |
+
"2": {
|
18 |
+
"sr": 11025,
|
19 |
+
"hl": 128,
|
20 |
+
"n_fft": 512,
|
21 |
+
"crop_start": 4,
|
22 |
+
"crop_stop": 185,
|
23 |
+
"hpf_start": 36,
|
24 |
+
"hpf_stop": 18,
|
25 |
+
"lpf_start": 93,
|
26 |
+
"lpf_stop": 185,
|
27 |
+
"res_type": "polyphase"
|
28 |
+
},
|
29 |
+
"3": {
|
30 |
+
"sr": 22050,
|
31 |
+
"hl": 256,
|
32 |
+
"n_fft": 512,
|
33 |
+
"crop_start": 46,
|
34 |
+
"crop_stop": 186,
|
35 |
+
"hpf_start": 93,
|
36 |
+
"hpf_stop": 46,
|
37 |
+
"lpf_start": 164,
|
38 |
+
"lpf_stop": 186,
|
39 |
+
"res_type": "polyphase"
|
40 |
+
},
|
41 |
+
"4": {
|
42 |
+
"sr": 44100,
|
43 |
+
"hl": 512,
|
44 |
+
"n_fft": 768,
|
45 |
+
"crop_start": 121,
|
46 |
+
"crop_stop": 382,
|
47 |
+
"hpf_start": 138,
|
48 |
+
"hpf_stop": 123,
|
49 |
+
"res_type": "sinc_medium"
|
50 |
+
}
|
51 |
+
},
|
52 |
+
"sr": 44100,
|
53 |
+
"pre_filter_start": 740,
|
54 |
+
"pre_filter_stop": 768
|
55 |
+
}
|
uvr5_pack/lib_v5/modelparams/4band_44100_msb.json
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"mid_side_b": true,
|
3 |
+
"bins": 768,
|
4 |
+
"unstable_bins": 7,
|
5 |
+
"reduction_bins": 668,
|
6 |
+
"band": {
|
7 |
+
"1": {
|
8 |
+
"sr": 11025,
|
9 |
+
"hl": 128,
|
10 |
+
"n_fft": 1024,
|
11 |
+
"crop_start": 0,
|
12 |
+
"crop_stop": 186,
|
13 |
+
"lpf_start": 37,
|
14 |
+
"lpf_stop": 73,
|
15 |
+
"res_type": "polyphase"
|
16 |
+
},
|
17 |
+
"2": {
|
18 |
+
"sr": 11025,
|
19 |
+
"hl": 128,
|
20 |
+
"n_fft": 512,
|
21 |
+
"crop_start": 4,
|
22 |
+
"crop_stop": 185,
|
23 |
+
"hpf_start": 36,
|
24 |
+
"hpf_stop": 18,
|
25 |
+
"lpf_start": 93,
|
26 |
+
"lpf_stop": 185,
|
27 |
+
"res_type": "polyphase"
|
28 |
+
},
|
29 |
+
"3": {
|
30 |
+
"sr": 22050,
|
31 |
+
"hl": 256,
|
32 |
+
"n_fft": 512,
|
33 |
+
"crop_start": 46,
|
34 |
+
"crop_stop": 186,
|
35 |
+
"hpf_start": 93,
|
36 |
+
"hpf_stop": 46,
|
37 |
+
"lpf_start": 164,
|
38 |
+
"lpf_stop": 186,
|
39 |
+
"res_type": "polyphase"
|
40 |
+
},
|
41 |
+
"4": {
|
42 |
+
"sr": 44100,
|
43 |
+
"hl": 512,
|
44 |
+
"n_fft": 768,
|
45 |
+
"crop_start": 121,
|
46 |
+
"crop_stop": 382,
|
47 |
+
"hpf_start": 138,
|
48 |
+
"hpf_stop": 123,
|
49 |
+
"res_type": "sinc_medium"
|
50 |
+
}
|
51 |
+
},
|
52 |
+
"sr": 44100,
|
53 |
+
"pre_filter_start": 740,
|
54 |
+
"pre_filter_stop": 768
|
55 |
+
}
|
uvr5_pack/lib_v5/modelparams/4band_44100_msb2.json
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"mid_side_b": true,
|
3 |
+
"bins": 768,
|
4 |
+
"unstable_bins": 7,
|
5 |
+
"reduction_bins": 668,
|
6 |
+
"band": {
|
7 |
+
"1": {
|
8 |
+
"sr": 11025,
|
9 |
+
"hl": 128,
|
10 |
+
"n_fft": 1024,
|
11 |
+
"crop_start": 0,
|
12 |
+
"crop_stop": 186,
|
13 |
+
"lpf_start": 37,
|
14 |
+
"lpf_stop": 73,
|
15 |
+
"res_type": "polyphase"
|
16 |
+
},
|
17 |
+
"2": {
|
18 |
+
"sr": 11025,
|
19 |
+
"hl": 128,
|
20 |
+
"n_fft": 512,
|
21 |
+
"crop_start": 4,
|
22 |
+
"crop_stop": 185,
|
23 |
+
"hpf_start": 36,
|
24 |
+
"hpf_stop": 18,
|
25 |
+
"lpf_start": 93,
|
26 |
+
"lpf_stop": 185,
|
27 |
+
"res_type": "polyphase"
|
28 |
+
},
|
29 |
+
"3": {
|
30 |
+
"sr": 22050,
|
31 |
+
"hl": 256,
|
32 |
+
"n_fft": 512,
|
33 |
+
"crop_start": 46,
|
34 |
+
"crop_stop": 186,
|
35 |
+
"hpf_start": 93,
|
36 |
+
"hpf_stop": 46,
|
37 |
+
"lpf_start": 164,
|
38 |
+
"lpf_stop": 186,
|
39 |
+
"res_type": "polyphase"
|
40 |
+
},
|
41 |
+
"4": {
|
42 |
+
"sr": 44100,
|
43 |
+
"hl": 512,
|
44 |
+
"n_fft": 768,
|
45 |
+
"crop_start": 121,
|
46 |
+
"crop_stop": 382,
|
47 |
+
"hpf_start": 138,
|
48 |
+
"hpf_stop": 123,
|
49 |
+
"res_type": "sinc_medium"
|
50 |
+
}
|
51 |
+
},
|
52 |
+
"sr": 44100,
|
53 |
+
"pre_filter_start": 740,
|
54 |
+
"pre_filter_stop": 768
|
55 |
+
}
|
uvr5_pack/lib_v5/modelparams/4band_44100_reverse.json
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"reverse": true,
|
3 |
+
"bins": 768,
|
4 |
+
"unstable_bins": 7,
|
5 |
+
"reduction_bins": 668,
|
6 |
+
"band": {
|
7 |
+
"1": {
|
8 |
+
"sr": 11025,
|
9 |
+
"hl": 128,
|
10 |
+
"n_fft": 1024,
|
11 |
+
"crop_start": 0,
|
12 |
+
"crop_stop": 186,
|
13 |
+
"lpf_start": 37,
|
14 |
+
"lpf_stop": 73,
|
15 |
+
"res_type": "polyphase"
|
16 |
+
},
|
17 |
+
"2": {
|
18 |
+
"sr": 11025,
|
19 |
+
"hl": 128,
|
20 |
+
"n_fft": 512,
|
21 |
+
"crop_start": 4,
|
22 |
+
"crop_stop": 185,
|
23 |
+
"hpf_start": 36,
|
24 |
+
"hpf_stop": 18,
|
25 |
+
"lpf_start": 93,
|
26 |
+
"lpf_stop": 185,
|
27 |
+
"res_type": "polyphase"
|
28 |
+
},
|
29 |
+
"3": {
|
30 |
+
"sr": 22050,
|
31 |
+
"hl": 256,
|
32 |
+
"n_fft": 512,
|
33 |
+
"crop_start": 46,
|
34 |
+
"crop_stop": 186,
|
35 |
+
"hpf_start": 93,
|
36 |
+
"hpf_stop": 46,
|
37 |
+
"lpf_start": 164,
|
38 |
+
"lpf_stop": 186,
|
39 |
+
"res_type": "polyphase"
|
40 |
+
},
|
41 |
+
"4": {
|
42 |
+
"sr": 44100,
|
43 |
+
"hl": 512,
|
44 |
+
"n_fft": 768,
|
45 |
+
"crop_start": 121,
|
46 |
+
"crop_stop": 382,
|
47 |
+
"hpf_start": 138,
|
48 |
+
"hpf_stop": 123,
|
49 |
+
"res_type": "sinc_medium"
|
50 |
+
}
|
51 |
+
},
|
52 |
+
"sr": 44100,
|
53 |
+
"pre_filter_start": 740,
|
54 |
+
"pre_filter_stop": 768
|
55 |
+
}
|