PhoenixStormJr commited on
Commit
5d5d66b
·
verified ·
1 Parent(s): 35d8b90

Update infer_uvr5.py

Browse files
Files changed (1) hide show
  1. infer_uvr5.py +4 -4
infer_uvr5.py CHANGED
@@ -61,7 +61,7 @@ class _audio_pre_:
61
  (
62
  X_wave[d],
63
  _,
64
- ) = librosa.core.load( # 理论上librosa读取可能对某些音频有bug,应该上ffmpeg读取,但是太麻烦了弃坑
65
  music_file,
66
  bp["sr"],
67
  False,
@@ -211,7 +211,7 @@ class _audio_pre_new:
211
 
212
  def _path_audio_(
213
  self, music_file, vocal_root=None, ins_root=None, format="flac"
214
- ): # 3VR模型vocal和ins是反的
215
  if ins_root is None and vocal_root is None:
216
  return "No save root."
217
  name = os.path.basename(music_file)
@@ -228,7 +228,7 @@ class _audio_pre_new:
228
  (
229
  X_wave[d],
230
  _,
231
- ) = librosa.core.load( # 理论上librosa读取可能对某些音频有bug,应该上ffmpeg读取,但是太麻烦了弃坑
232
  music_file,
233
  bp["sr"],
234
  False,
@@ -358,6 +358,6 @@ if __name__ == "__main__":
358
  model_path = "uvr5_weights/DeEchoNormal.pth"
359
  # pre_fun = _audio_pre_(model_path=model_path, device=device, is_half=True,agg=10)
360
  pre_fun = _audio_pre_new(model_path=model_path, device=device, is_half=True, agg=10)
361
- audio_path = "雪雪伴奏对消HP5.wav"
362
  save_path = "opt"
363
  pre_fun._path_audio_(audio_path, save_path, save_path)
 
61
  (
62
  X_wave[d],
63
  _,
64
+ ) = librosa.core.load( # Theoretically, librosa reading may have bugs for some audios, and ffmpeg should be used for reading, but it is too troublesome and I gave up.
65
  music_file,
66
  bp["sr"],
67
  False,
 
211
 
212
  def _path_audio_(
213
  self, music_file, vocal_root=None, ins_root=None, format="flac"
214
+ ): # The vocal and ins of 3 VR models are reversed
215
  if ins_root is None and vocal_root is None:
216
  return "No save root."
217
  name = os.path.basename(music_file)
 
228
  (
229
  X_wave[d],
230
  _,
231
+ ) = librosa.core.load( # Theoretically, librosa reading may have bugs for some audios, and ffmpeg should be used for reading, but it is too troublesome and I gave up.
232
  music_file,
233
  bp["sr"],
234
  False,
 
358
  model_path = "uvr5_weights/DeEchoNormal.pth"
359
  # pre_fun = _audio_pre_(model_path=model_path, device=device, is_half=True,agg=10)
360
  pre_fun = _audio_pre_new(model_path=model_path, device=device, is_half=True, agg=10)
361
+ audio_path = "Snowy accompaniment cancellation HP5.wav"
362
  save_path = "opt"
363
  pre_fun._path_audio_(audio_path, save_path, save_path)