From ae434b71941da5107d8f4cb6ee193f6c909ba132 Mon Sep 17 00:00:00 2001 From: Dilan Boskan Date: Thu, 14 Jan 2021 16:40:14 +0100 Subject: [PATCH] Fixed parameters not actually parsing through --- .gitignore | 3 ++- VocalRemover.py | 8 ++++++-- inference_v2.py | 8 +++++++- inference_v4.py | 8 +++++++- 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index fbc624f..01362ca 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ data.pkl # Testing models model_iter26_sr33075_hl384_w512.pth baseline.pth -temp.wav \ No newline at end of file +temp.wav +models/**/*.pth \ No newline at end of file diff --git a/VocalRemover.py b/VocalRemover.py index db4ac64..5d58c39 100644 --- a/VocalRemover.py +++ b/VocalRemover.py @@ -671,7 +671,8 @@ class MainWindow(TkinterDnD.Tk): instrumental = get_model_values(self.instrumentalModel_var.get()) stacked = get_model_values(self.stackedModel_var.get()) try: - if [bool(instrumental), bool(stacked)].count(True) == 2: + if ([bool(instrumental), bool(stacked)].count(True) == 2 and + not self.manType_var.get()): sr = DEFAULT_DATA['sr'] hop_length = DEFAULT_DATA['hop_length'] window_size = DEFAULT_DATA['window_size'] @@ -756,6 +757,8 @@ class MainWindow(TkinterDnD.Tk): 'n_fft': n_fft, # not needed for v2 # Resolution Type 'resType': resType, + # Parsed constants should be fixed + 'manType': self.manType_var.get(), # Other Variables (Tkinter) 'window': self, 'text_widget': self.command_Text, @@ -974,7 +977,8 @@ class MainWindow(TkinterDnD.Tk): # Get constants instrumental = get_model_values(self.instrumentalModel_var.get()) stacked = get_model_values(self.stackedModel_var.get()) - if [bool(instrumental), bool(stacked)].count(True) == 2: + if ([bool(instrumental), bool(stacked)].count(True) == 2 and + not self.manType_var.get()): sr = DEFAULT_DATA['sr'] hop_length = DEFAULT_DATA['hop_length'] window_size = DEFAULT_DATA['window_size'] diff --git a/inference_v2.py b/inference_v2.py index cc072b9..854eae8 100644 --- a/inference_v2.py +++ b/inference_v2.py @@ -54,7 +54,9 @@ data = { 'window_size': 320, 'n_fft': 2_048, # Resolution Type - 'resType': 'kaiser_fast' + 'resType': 'kaiser_fast', + # Parsed constants should be fixed + 'manType': False, } default_sr = data['sr'] default_hop_length = data['hop_length'] @@ -94,6 +96,10 @@ def update_constants(model_name): data['window_size'] = default_window_size data['n_fft'] = default_n_fft + if data['manType']: + # Default constants should be fixed + return + for text_part in text_parts: if 'sr' in text_part: text_part = text_part.replace('sr', '') diff --git a/inference_v4.py b/inference_v4.py index 2629386..2c1fb98 100644 --- a/inference_v4.py +++ b/inference_v4.py @@ -176,7 +176,9 @@ data = { 'window_size': 320, 'n_fft': 2_048, # Resolution Type - 'resType': 'kaiser_fast' + 'resType': 'kaiser_fast', + # Parsed constants should be fixed + 'manType': False, } default_sr = data['sr'] default_hop_length = data['hop_length'] @@ -214,6 +216,10 @@ def update_constants(model_name): data['window_size'] = default_window_size data['n_fft'] = default_n_fft + if data['manType']: + # Default constants should be fixed + return + for text_part in text_parts: if 'sr' in text_part: text_part = text_part.replace('sr', '')