Add files via upload

This commit is contained in:
Anjok07 2022-04-07 19:10:06 -05:00 committed by GitHub
parent 98d55b7354
commit ab6ca173ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 6 deletions

View File

@ -547,6 +547,11 @@ class MainWindow(TkinterDnD.Tk):
message='You have selected an invalid music file! Please make sure that the file still exists!',
detail=f'File path: {path}')
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):
tk.messagebox.showwarning(master=self,
title='Invalid Export Directory',

View File

@ -109,9 +109,11 @@ class VocalRemover(object):
pred = pred.detach().cpu().numpy()
preds.append(pred[0])
pred = np.concatenate(preds, axis=2)
return pred
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"""
base = (100 / total_files)
progress = base * (file_num - 1)
progress += step
progress += base * step
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']),
file_num=file_num)
progress_kwargs = {'progress_var': progress_var,
'total_files': len(data['input_paths']),
'file_num': file_num}
'total_files': len(data['input_paths']),
'file_num': file_num}
update_progress(**progress_kwargs,
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')
update_progress(**progress_kwargs,
step=0.7)
step=1)
# Save output music files
text_widget.write(base_text + 'Saving Files...\n')
save_files(wav_instrument, wav_vocals)
text_widget.write(base_text + 'Done!\n')
update_progress(**progress_kwargs,
step=0.8)
step=1)
# Save output image
if data['output_image']: