mirror of
https://github.com/Anjok07/ultimatevocalremovergui.git
synced 2025-02-17 11:18:37 +01:00
Add files via upload
This commit is contained in:
parent
6cedc85a10
commit
f17e31bd51
@ -1,36 +1,15 @@
|
|||||||
import json
|
import json
|
||||||
import pathlib
|
|
||||||
|
|
||||||
default_param = {}
|
default_param = {}
|
||||||
default_param['bins'] = 768
|
default_param['bins'] = -1
|
||||||
default_param['unstable_bins'] = 9 # training only
|
default_param['unstable_bins'] = -1 # training only
|
||||||
default_param['reduction_bins'] = 762 # training only
|
default_param['stable_bins'] = -1 # training only
|
||||||
default_param['sr'] = 44100
|
default_param['sr'] = 44100
|
||||||
default_param['pre_filter_start'] = 757
|
default_param['pre_filter_start'] = -1
|
||||||
default_param['pre_filter_stop'] = 768
|
default_param['pre_filter_stop'] = -1
|
||||||
default_param['band'] = {}
|
default_param['band'] = {}
|
||||||
|
|
||||||
|
N_BINS = 'n_bins'
|
||||||
default_param['band'][1] = {
|
|
||||||
'sr': 11025,
|
|
||||||
'hl': 128,
|
|
||||||
'n_fft': 960,
|
|
||||||
'crop_start': 0,
|
|
||||||
'crop_stop': 245,
|
|
||||||
'lpf_start': 61, # inference only
|
|
||||||
'res_type': 'polyphase'
|
|
||||||
}
|
|
||||||
|
|
||||||
default_param['band'][2] = {
|
|
||||||
'sr': 44100,
|
|
||||||
'hl': 512,
|
|
||||||
'n_fft': 1536,
|
|
||||||
'crop_start': 24,
|
|
||||||
'crop_stop': 547,
|
|
||||||
'hpf_start': 81, # inference only
|
|
||||||
'res_type': 'sinc_best'
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def int_keys(d):
|
def int_keys(d):
|
||||||
r = {}
|
r = {}
|
||||||
@ -40,20 +19,14 @@ def int_keys(d):
|
|||||||
r[k] = v
|
r[k] = v
|
||||||
return r
|
return r
|
||||||
|
|
||||||
|
|
||||||
class ModelParameters(object):
|
class ModelParameters(object):
|
||||||
def __init__(self, config_path=''):
|
def __init__(self, config_path=''):
|
||||||
if '.pth' == pathlib.Path(config_path).suffix:
|
with open(config_path, 'r') as f:
|
||||||
import zipfile
|
|
||||||
|
|
||||||
with zipfile.ZipFile(config_path, 'r') as zip:
|
|
||||||
self.param = json.loads(zip.read('param.json'), object_pairs_hook=int_keys)
|
|
||||||
elif '.json' == pathlib.Path(config_path).suffix:
|
|
||||||
with open(config_path, 'r') as f:
|
|
||||||
self.param = json.loads(f.read(), object_pairs_hook=int_keys)
|
self.param = json.loads(f.read(), object_pairs_hook=int_keys)
|
||||||
else:
|
|
||||||
self.param = default_param
|
|
||||||
|
|
||||||
for k in ['mid_side', 'mid_side_b', 'mid_side_b2', 'stereo_w', 'stereo_n', 'reverse']:
|
for k in ['mid_side', 'mid_side_b', 'mid_side_b2', 'stereo_w', 'stereo_n', 'reverse']:
|
||||||
if not k in self.param:
|
if not k in self.param:
|
||||||
self.param[k] = False
|
self.param[k] = False
|
||||||
|
|
||||||
|
if N_BINS in self.param:
|
||||||
|
self.param['bins'] = self.param[N_BINS]
|
55
lib_v5/vr_network/modelparams/4band_v3_sn.json
Normal file
55
lib_v5/vr_network/modelparams/4band_v3_sn.json
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
{
|
||||||
|
"n_bins": 672,
|
||||||
|
"unstable_bins": 8,
|
||||||
|
"stable_bins": 530,
|
||||||
|
"band": {
|
||||||
|
"1": {
|
||||||
|
"sr": 7350,
|
||||||
|
"hl": 80,
|
||||||
|
"n_fft": 640,
|
||||||
|
"crop_start": 0,
|
||||||
|
"crop_stop": 85,
|
||||||
|
"lpf_start": 25,
|
||||||
|
"lpf_stop": 53,
|
||||||
|
"res_type": "polyphase"
|
||||||
|
},
|
||||||
|
"2": {
|
||||||
|
"sr": 7350,
|
||||||
|
"hl": 80,
|
||||||
|
"n_fft": 320,
|
||||||
|
"crop_start": 4,
|
||||||
|
"crop_stop": 87,
|
||||||
|
"hpf_start": 25,
|
||||||
|
"hpf_stop": 12,
|
||||||
|
"lpf_start": 31,
|
||||||
|
"lpf_stop": 62,
|
||||||
|
"res_type": "polyphase"
|
||||||
|
},
|
||||||
|
"3": {
|
||||||
|
"sr": 14700,
|
||||||
|
"hl": 160,
|
||||||
|
"n_fft": 512,
|
||||||
|
"crop_start": 17,
|
||||||
|
"crop_stop": 216,
|
||||||
|
"hpf_start": 48,
|
||||||
|
"hpf_stop": 24,
|
||||||
|
"lpf_start": 139,
|
||||||
|
"lpf_stop": 210,
|
||||||
|
"res_type": "polyphase"
|
||||||
|
},
|
||||||
|
"4": {
|
||||||
|
"sr": 44100,
|
||||||
|
"hl": 480,
|
||||||
|
"n_fft": 960,
|
||||||
|
"crop_start": 78,
|
||||||
|
"crop_stop": 383,
|
||||||
|
"hpf_start": 130,
|
||||||
|
"hpf_stop": 86,
|
||||||
|
"convert_channels": "stereo_n",
|
||||||
|
"res_type": "kaiser_fast"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"sr": 44100,
|
||||||
|
"pre_filter_start": 668,
|
||||||
|
"pre_filter_stop": 672
|
||||||
|
}
|
@ -40,26 +40,26 @@ class BaseNet(nn.Module):
|
|||||||
|
|
||||||
class CascadedNet(nn.Module):
|
class CascadedNet(nn.Module):
|
||||||
|
|
||||||
def __init__(self, n_fft, nn_arch_size, nout=32, nout_lstm=128):
|
def __init__(self, n_fft, nn_arch_size=51000, nout=32, nout_lstm=128):
|
||||||
super(CascadedNet, self).__init__()
|
super(CascadedNet, self).__init__()
|
||||||
|
|
||||||
self.max_bin = n_fft // 2
|
self.max_bin = n_fft // 2
|
||||||
self.output_bin = n_fft // 2 + 1
|
self.output_bin = n_fft // 2 + 1
|
||||||
self.nin_lstm = self.max_bin // 2
|
self.nin_lstm = self.max_bin // 2
|
||||||
self.offset = 64
|
self.offset = 64
|
||||||
nout = 64 if nn_arch_size == 218409 else nout
|
nout = 64 if nn_arch_size == 218409 else nout
|
||||||
|
|
||||||
|
#print(nout, nout_lstm, n_fft)
|
||||||
|
|
||||||
self.stg1_low_band_net = nn.Sequential(
|
self.stg1_low_band_net = nn.Sequential(
|
||||||
BaseNet(2, nout // 2, self.nin_lstm // 2, nout_lstm),
|
BaseNet(2, nout // 2, self.nin_lstm // 2, nout_lstm),
|
||||||
layers.Conv2DBNActiv(nout // 2, nout // 4, 1, 1, 0)
|
layers.Conv2DBNActiv(nout // 2, nout // 4, 1, 1, 0)
|
||||||
)
|
)
|
||||||
|
|
||||||
self.stg1_high_band_net = BaseNet(2, nout // 4, self.nin_lstm // 2, nout_lstm // 2)
|
self.stg1_high_band_net = BaseNet(2, nout // 4, self.nin_lstm // 2, nout_lstm // 2)
|
||||||
|
|
||||||
self.stg2_low_band_net = nn.Sequential(
|
self.stg2_low_band_net = nn.Sequential(
|
||||||
BaseNet(nout // 4 + 2, nout, self.nin_lstm // 2, nout_lstm),
|
BaseNet(nout // 4 + 2, nout, self.nin_lstm // 2, nout_lstm),
|
||||||
layers.Conv2DBNActiv(nout, nout // 2, 1, 1, 0)
|
layers.Conv2DBNActiv(nout, nout // 2, 1, 1, 0)
|
||||||
)
|
)
|
||||||
self.stg2_high_band_net = BaseNet(nout // 4 + 2, nout // 2, self.nin_lstm // 2, nout_lstm // 2)
|
self.stg2_high_band_net = BaseNet(nout // 4 + 2, nout // 2, self.nin_lstm // 2, nout_lstm // 2)
|
||||||
|
|
||||||
self.stg3_full_band_net = BaseNet(3 * nout // 4 + 2, nout, self.nin_lstm, nout_lstm)
|
self.stg3_full_band_net = BaseNet(3 * nout // 4 + 2, nout, self.nin_lstm, nout_lstm)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user