helloWorld199 commited on
Commit
8b791ee
·
verified ·
1 Parent(s): 29d42a1

Update src/main.py

Browse files
Files changed (1) hide show
  1. src/main.py +8 -7
src/main.py CHANGED
@@ -181,13 +181,13 @@ def preprocess_song(song_input, mdx_model_params, song_id, is_webui, input_type,
181
  display_progress('[~] Separating Vocals from Instrumental...', 0.1, is_webui, progress)
182
  vocals_path, instrumentals_path = run_mdx(mdx_model_params, song_output_dir, os.path.join(mdxnet_models_dir, 'UVR-MDX-NET-Voc_FT.onnx'), orig_song_path, denoise=True, keep_orig=keep_orig, _stemname1 = "_origvocals", _stemname2="_originstr")
183
 
184
- display_progress('[~] Separating Main Vocals from Backup Vocals...', 0.2, is_webui, progress)
185
- backup_vocals_path, main_vocals_path = run_mdx(mdx_model_params, song_output_dir, os.path.join(mdxnet_models_dir, 'UVR_MDXNET_KARA_2.onnx'), vocals_path, suffix='Backup', invert_suffix='Main', denoise=True)
186
 
187
- display_progress('[~] Applying DeReverb to Vocals...', 0.3, is_webui, progress)
188
- _, main_vocals_dereverb_path = run_mdx(mdx_model_params, song_output_dir, os.path.join(mdxnet_models_dir, 'Reverb_HQ_By_FoxJoy.onnx'), main_vocals_path, invert_suffix='DeReverb', exclude_main=True, denoise=True)
189
 
190
- return orig_song_path, vocals_path, instrumentals_path, main_vocals_path, backup_vocals_path, main_vocals_dereverb_path
191
 
192
 
193
  def voice_change(voice_model, vocals_path, output_path, pitch_change, f0_method, index_rate, filter_radius, rms_mix_rate, protect, crepe_hop_length, is_webui):
@@ -268,7 +268,7 @@ def song_cover_pipeline(song_input, voice_model, pitch_change, keep_files,
268
 
269
  if not os.path.exists(song_dir):
270
  os.makedirs(song_dir)
271
- orig_song_path, vocals_path, instrumentals_path, main_vocals_path, backup_vocals_path, main_vocals_dereverb_path = preprocess_song(song_input, mdx_model_params, song_id, is_webui, input_type, progress)
272
  print(vocals_path, instrumentals_path)
273
  return vocals_path, instrumentals_path
274
 
@@ -278,10 +278,11 @@ def song_cover_pipeline(song_input, voice_model, pitch_change, keep_files,
278
 
279
  # if any of the audio files aren't available or keep intermediate files, rerun preprocess
280
  if any(path is None for path in paths) or keep_files:
281
- orig_song_path, vocals_path, instrumentals_path, main_vocals_path, backup_vocals_path, main_vocals_dereverb_path = preprocess_song(song_input, mdx_model_params, song_id, is_webui, input_type, progress)
282
  print(vocals_path, instrumentals_path)
283
  return vocals_path, instrumentals_path
284
  else:
 
285
  orig_song_path, instrumentals_path, main_vocals_dereverb_path, backup_vocals_path = paths
286
 
287
  print("ARRIVATO QUA, ERRORE")
 
181
  display_progress('[~] Separating Vocals from Instrumental...', 0.1, is_webui, progress)
182
  vocals_path, instrumentals_path = run_mdx(mdx_model_params, song_output_dir, os.path.join(mdxnet_models_dir, 'UVR-MDX-NET-Voc_FT.onnx'), orig_song_path, denoise=True, keep_orig=keep_orig, _stemname1 = "_origvocals", _stemname2="_originstr")
183
 
184
+ #display_progress('[~] Separating Main Vocals from Backup Vocals...', 0.2, is_webui, progress)
185
+ #backup_vocals_path, main_vocals_path = run_mdx(mdx_model_params, song_output_dir, os.path.join(mdxnet_models_dir, 'UVR_MDXNET_KARA_2.onnx'), vocals_path, suffix='Backup', invert_suffix='Main', denoise=True)
186
 
187
+ #display_progress('[~] Applying DeReverb to Vocals...', 0.3, is_webui, progress)
188
+ #_, main_vocals_dereverb_path = run_mdx(mdx_model_params, song_output_dir, os.path.join(mdxnet_models_dir, 'Reverb_HQ_By_FoxJoy.onnx'), main_vocals_path, invert_suffix='DeReverb', exclude_main=True, denoise=True)
189
 
190
+ return orig_song_path, vocals_path, instrumentals_path#, main_vocals_path, backup_vocals_path, main_vocals_dereverb_path
191
 
192
 
193
  def voice_change(voice_model, vocals_path, output_path, pitch_change, f0_method, index_rate, filter_radius, rms_mix_rate, protect, crepe_hop_length, is_webui):
 
268
 
269
  if not os.path.exists(song_dir):
270
  os.makedirs(song_dir)
271
+ orig_song_path, vocals_path, instrumentals_path= preprocess_song(song_input, mdx_model_params, song_id, is_webui, input_type, progress)
272
  print(vocals_path, instrumentals_path)
273
  return vocals_path, instrumentals_path
274
 
 
278
 
279
  # if any of the audio files aren't available or keep intermediate files, rerun preprocess
280
  if any(path is None for path in paths) or keep_files:
281
+ orig_song_path, vocals_path, instrumentals_path= preprocess_song(song_input, mdx_model_params, song_id, is_webui, input_type, progress)
282
  print(vocals_path, instrumentals_path)
283
  return vocals_path, instrumentals_path
284
  else:
285
+ print("ENTRATO ELSE, ERRORE!")
286
  orig_song_path, instrumentals_path, main_vocals_dereverb_path, backup_vocals_path = paths
287
 
288
  print("ARRIVATO QUA, ERRORE")