Add files via upload

This commit is contained in:
Anjok07 2022-12-23 01:45:18 -06:00 committed by GitHub
parent 25e789b4e1
commit cbd25a20d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 66 deletions

58
UVR.py
View File

@ -195,50 +195,6 @@ def drop(event, accept_mode: str = 'files'):
else:
# Invalid accept mode
return
#FIXME:
# def drop(event, accept_mode: str = 'files'):
# """Drag & Drop verification process"""
# path: str
# path = event.data
# #if RIGHT_BRACKET in path or LEFT_BRACKET in path:
# if path.startswith(LEFT_BRACKET):
# path = path[1:]
# if path.endswith(RIGHT_BRACKET):
# path = path[:-1]
# print(path)
# if accept_mode == 'folder':
# if not os.path.isdir(path):
# tk.messagebox.showerror(title='Invalid Folder',
# message='Your given export path is not a valid folder!')
# return
# # Set Variables
# root.export_path_var.set(path)
# elif accept_mode == 'files':
# # Clean path text and set path to the list of paths
# for drive_letter in list(string.ascii_lowercase.upper()):
# path = path.replace(f"{DOUBLE_BRACKET}{drive_letter}:", f";{drive_letter}:")
# path = path.replace(f"{RIGHT_BRACKET} {drive_letter}:", f";{drive_letter}:")
# path = path.replace(f" {LEFT_BRACKET}{drive_letter}:", f";{drive_letter}:")
# path = path.split(';')
# path[-1] = path[-1].replace(';', '')
# # Set Variables
# root.inputPaths = tuple(path)
# root.process_input_selections()
# root.update_inputPaths()
# else:
# # Invalid accept mode
# return
class ModelData():
def __init__(self, model_name: str,
@ -284,13 +240,11 @@ class ModelData():
self.model_samplerate = 44100
self.is_demucs_pre_proc_model_inst_mix = False
self.manual_download_Button = None
self.secondary_model_4_stem = []
self.secondary_model_4_stem_scale = []
self.secondary_model_4_stem_names = []
self.secondary_model_4_stem_model_names_list = []
self.all_models = []
self.secondary_model_other = None
self.secondary_model_scale_other = None
self.secondary_model_bass = None
@ -373,15 +327,12 @@ class ModelData():
self.is_primary_model_secondary_stem_only = is_primary_model_secondary_stem_only
if self.is_secondary_model_activated and self.model_status:
if (not self.is_ensemble_mode and root.demucs_stems_var.get() == ALL_STEMS and self.process_method == DEMUCS_ARCH_TYPE) or self.is_4_stem_ensemble:
for key in DEMUCS_4_SOURCE_LIST:
self.secondary_model_data(key)
self.secondary_model_4_stem.append(self.secondary_model)
self.secondary_model_4_stem_scale.append(self.secondary_model_scale)
self.secondary_model_4_stem_names.append(key)
self.demucs_4_stem_added_count = sum(i is not None for i in self.secondary_model_4_stem)
self.is_secondary_model_activated = False if all(i is None for i in self.secondary_model_4_stem) else True
self.demucs_4_stem_added_count = self.demucs_4_stem_added_count - 1 if self.is_secondary_model_activated else self.demucs_4_stem_added_count
@ -562,7 +513,7 @@ class Ensembler():
save_format(stem_save_path, self.save_format, self.mp3_bit_set)
def get_files_to_ensemble(self, folder="", prefix="", suffix=""):
"""Grab all the files to be ensembles"""
"""Grab all the files to be ensembled"""
return [os.path.join(folder, i) for i in os.listdir(folder) if i.startswith(prefix) and i.endswith(suffix)]
@ -613,8 +564,8 @@ class ToolTip(object):
tw.wm_overrideredirect(1)
tw.wm_geometry("+%d+%d" % (x, y))
label = Label(tw, text=self.text, justify=LEFT,
background="#ffffe0", foreground="black", relief=SOLID, borderwidth=1,
font=("tahoma", f"{FONT_SIZE_1}", "normal"))
background="#151515", foreground="#dedede", highlightcolor="#898b8e", relief=SOLID, borderwidth=1,
font=("Century Gothic", f"{FONT_SIZE_1}", "normal"))#('Century Gothic', FONT_SIZE_4)
label.pack(ipadx=1)
def hidetip(self):
@ -1057,6 +1008,7 @@ class MainWindow(TkinterDnD.Tk):
self.filePaths_musicFile_Open.place(x=-45, y=160, width=35, height=33, relx=1, rely=0, relwidth=0, relheight=0)
self.filePaths_musicFile_Entry.configure(cursor="hand2")
self.help_hints(self.filePaths_musicFile_Button, text=INPUT_FOLDER_ENTRY_HELP)
self.help_hints(self.filePaths_musicFile_Entry, text=INPUT_FOLDER_ENTRY_HELP_2)
self.help_hints(self.filePaths_musicFile_Open, text=INPUT_FOLDER_BUTTON_HELP)
# Save To Option
@ -4979,7 +4931,5 @@ if __name__ == "__main__":
print(e)
root = MainWindow()
root.update_checkbox_text()
root.mainloop()

View File

@ -61,14 +61,13 @@ class SeperateAttributes:
self.is_primary_stem_only = model_data.is_primary_stem_only if not self.is_secondary_model else model_data.is_primary_model_primary_stem_only
self.is_secondary_stem_only = model_data.is_secondary_stem_only if not self.is_secondary_model else model_data.is_primary_model_secondary_stem_only
self.is_ensemble_mode = model_data.is_ensemble_mode
self.secondary_model = model_data.secondary_model #VERIFY WHERE
self.secondary_model = model_data.secondary_model #
self.primary_model_primary_stem = model_data.primary_model_primary_stem
self.primary_stem = model_data.primary_stem #-
self.secondary_stem = model_data.secondary_stem #-
self.primary_stem = model_data.primary_stem #
self.secondary_stem = model_data.secondary_stem #
self.is_invert_spec = model_data.is_invert_spec #
self.secondary_model_scale = model_data.secondary_model_scale #
self.is_demucs_pre_proc_model_inst_mix = model_data.is_demucs_pre_proc_model_inst_mix #
#############################
self.primary_source_map = {}
self.secondary_source_map = {}
self.primary_source = None
@ -208,12 +207,6 @@ class SeperateAttributes:
if self.process_method == DEMUCS_ARCH_TYPE:
self.cached_model_source_holder(DEMUCS_ARCH_TYPE, secondary_sources, self.model_basename)
# if isinstance(secondary_sources, np.ndarray):
# print('\n==================================\n', secondary_sources, f"\n\nMemory size of source for model {self.model_basename}: ", secondary_sources.size * secondary_sources.itemsize, 'BYTES', '\n==================================\n')
# if type(secondary_sources) is dict:
# print('\n==================================\n', secondary_sources, f"\n\nMemory size of source for model {self.model_basename}: ", sum(v.size * v.itemsize for v in secondary_sources.values()), 'BYTES', '\n==================================\n')
def write_audio(self, stem_path, stem_source, samplerate, secondary_model_source=None, model_scale=None):
if not self.is_secondary_model:
@ -605,8 +598,6 @@ class SeperateVR(SeperateAttributes):
model_size = math.ceil(os.stat(self.model_path).st_size / 1024)
nn_architecture = min(nn_arch_sizes, key=lambda x:abs(x-model_size))
#print('ARC SIZE: ', nn_architecture)
if nn_architecture in vr_5_1_models:
print('NEW: ', nn_architecture)
model = nets_new.CascadedNet(self.mp.param['bins'] * 2, nn_architecture)