Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Anjok07 authored Apr 8, 2022
1 parent 98d55b7 commit ab6ca17
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
5 changes: 5 additions & 0 deletions VocalRemover.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,11 @@ def start_conversion(self):
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',
Expand Down
14 changes: 8 additions & 6 deletions inference_v5.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,11 @@ def _execute(self, X_mag_pad, roi_size, n_window, device, model, aggressiveness)

pred = pred.detach().cpu().numpy()
preds.append(pred[0])

pred = np.concatenate(preds, axis=2)



return pred

def preprocess(self, X_spec):
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -306,8 +308,8 @@ def save_files(wav_instrument, wav_vocals):
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)

Expand Down Expand Up @@ -397,14 +399,14 @@ def save_files(wav_instrument, wav_vocals):
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']:
Expand Down

0 comments on commit ab6ca17

Please sign in to comment.