Add files via upload
This commit is contained in:
@@ -547,6 +547,11 @@ class MainWindow(TkinterDnD.Tk):
|
|||||||
message='You have selected an invalid music file! Please make sure that the file still exists!',
|
message='You have selected an invalid music file! Please make sure that the file still exists!',
|
||||||
detail=f'File path: {path}')
|
detail=f'File path: {path}')
|
||||||
return
|
return
|
||||||
|
if not os.path.isfile(instrumentalModel_path):
|
||||||
|
tk.messagebox.showwarning(master=self,
|
||||||
|
title='Invalid Main Model File',
|
||||||
|
message='You have selected an invalid main model file!\nPlease make sure that your model file still exists!')
|
||||||
|
return
|
||||||
if not os.path.isdir(export_path):
|
if not os.path.isdir(export_path):
|
||||||
tk.messagebox.showwarning(master=self,
|
tk.messagebox.showwarning(master=self,
|
||||||
title='Invalid Export Directory',
|
title='Invalid Export Directory',
|
||||||
|
|||||||
@@ -112,6 +112,8 @@ class VocalRemover(object):
|
|||||||
|
|
||||||
pred = np.concatenate(preds, axis=2)
|
pred = np.concatenate(preds, axis=2)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return pred
|
return pred
|
||||||
|
|
||||||
def preprocess(self, X_spec):
|
def preprocess(self, X_spec):
|
||||||
@@ -197,7 +199,7 @@ def update_progress(progress_var, total_files, file_num, step: float = 1):
|
|||||||
"""Calculate the progress for the progress widget in the GUI"""
|
"""Calculate the progress for the progress widget in the GUI"""
|
||||||
base = (100 / total_files)
|
base = (100 / total_files)
|
||||||
progress = base * (file_num - 1)
|
progress = base * (file_num - 1)
|
||||||
progress += step
|
progress += base * step
|
||||||
|
|
||||||
progress_var.set(progress)
|
progress_var.set(progress)
|
||||||
|
|
||||||
@@ -306,8 +308,8 @@ def main(window: tk.Wm, text_widget: tk.Text, button_widget: tk.Button, progress
|
|||||||
base_text = get_baseText(total_files=len(data['input_paths']),
|
base_text = get_baseText(total_files=len(data['input_paths']),
|
||||||
file_num=file_num)
|
file_num=file_num)
|
||||||
progress_kwargs = {'progress_var': progress_var,
|
progress_kwargs = {'progress_var': progress_var,
|
||||||
'total_files': len(data['input_paths']),
|
'total_files': len(data['input_paths']),
|
||||||
'file_num': file_num}
|
'file_num': file_num}
|
||||||
update_progress(**progress_kwargs,
|
update_progress(**progress_kwargs,
|
||||||
step=0)
|
step=0)
|
||||||
|
|
||||||
@@ -397,14 +399,14 @@ def main(window: tk.Wm, text_widget: tk.Text, button_widget: tk.Button, progress
|
|||||||
text_widget.write(base_text + 'Done!\n')
|
text_widget.write(base_text + 'Done!\n')
|
||||||
|
|
||||||
update_progress(**progress_kwargs,
|
update_progress(**progress_kwargs,
|
||||||
step=0.7)
|
step=1)
|
||||||
# Save output music files
|
# Save output music files
|
||||||
text_widget.write(base_text + 'Saving Files...\n')
|
text_widget.write(base_text + 'Saving Files...\n')
|
||||||
save_files(wav_instrument, wav_vocals)
|
save_files(wav_instrument, wav_vocals)
|
||||||
text_widget.write(base_text + 'Done!\n')
|
text_widget.write(base_text + 'Done!\n')
|
||||||
|
|
||||||
update_progress(**progress_kwargs,
|
update_progress(**progress_kwargs,
|
||||||
step=0.8)
|
step=1)
|
||||||
|
|
||||||
# Save output image
|
# Save output image
|
||||||
if data['output_image']:
|
if data['output_image']:
|
||||||
|
|||||||
Reference in New Issue
Block a user