Open Bebra777228 opened 3 days ago
I suggest improving the functionality of the audio-separator by adding two new parameters to the separate function: primary_name and secondary_name.
separate
primary_name
secondary_name
As a result, the code will look like this:
INPUT_PATH = "/content/input/music.mp3" OUTPUT_PATH = "/content/output" VOCALS = os.path.join(OUTPUT_PATH, "Vocals.wav") INSTRUMENTAL = os.path.join(OUTPUT_PATH, "Instrumental.wav") separator = Separator(output_dir=OUTPUT_PATH) separator.load_model(model_filename="model_bs_roformer_ep_317_sdr_12.9755.ckpt") voc_inst_result = separator.separate(INPUT_PATH, VOCALS, INSTRUMENTAL) # or voc_inst_result = separator.separate(INPUT_PATH, primary_name=VOCALS, secondary_name=INSTRUMENTAL)
If these parameters are not specified, the files will be output in the same way they are saved now.
This will be a more convenient option compared to the current approach, which requires additional file renaming:
INPUT_PATH = "/content/input/music.mp3" OUTPUT_PATH = "/content/output" VOCALS = os.path.join(OUTPUT_PATH, "Vocals.wav") INSTRUMENTAL = os.path.join(OUTPUT_PATH, "Instrumental.wav") separator = Separator(output_dir=OUTPUT_PATH) separator.load_model(model_filename="model_bs_roformer_ep_317_sdr_12.9755.ckpt") voc_inst_result = separator.separate(INPUT_PATH) os.rename(os.path.join(output_dir, voc_inst_result[0]), INSTRUMENTAL) os.rename(os.path.join(output_dir, voc_inst_result[1]), VOCALS)
Hope my idea is clear!
Sure, fine by me if it doesn't break existing workflows - if you implement this in a PR, please add tests :)
I don't think I can do it, but I'll try :)
I suggest improving the functionality of the audio-separator by adding two new parameters to the
separate
function:primary_name
andsecondary_name
.As a result, the code will look like this:
If these parameters are not specified, the files will be output in the same way they are saved now.
This will be a more convenient option compared to the current approach, which requires additional file renaming:
Hope my idea is clear!