Skip to content

Commit

Permalink
typo&fix: remove unnecessary is_hp3 check
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama committed Nov 27, 2024
1 parent 9ee9f5f commit ba5572b
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 19 deletions.
2 changes: 1 addition & 1 deletion infer/lib/rvcmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def check_model(
def check_all_assets(update=False) -> bool:
BASE_DIR = Path(__file__).resolve().parent.parent.parent

logger.info("checking hubret & rmvpe...")
logger.info("checking hubert & rmvpe...")

if not check_model(
BASE_DIR / "assets" / "hubert",
Expand Down
2 changes: 1 addition & 1 deletion infer/modules/uvr5/mdxnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,5 +239,5 @@ def __init__(self, chunks, device):
self.pred = Predictor(self)
self.device = device

def _path_audio_(self, input, vocal_root, others_root, format, is_hp3=False):
def _path_audio_(self, input, vocal_root, others_root, format):
self.pred.prediction(input, vocal_root, others_root, format)
3 changes: 1 addition & 2 deletions infer/modules/uvr5/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ def uvr(model_name, inp_root, save_root_vocal, paths, save_root_ins, agg, format
device=config.device,
is_half=config.is_half,
)
is_hp3 = "HP3" in model_name
if inp_root != "":
paths = [os.path.join(inp_root, name) for name in os.listdir(inp_root)]
else:
Expand All @@ -51,7 +50,7 @@ def uvr(model_name, inp_root, save_root_vocal, paths, save_root_ins, agg, format
# Check the audio stream's properties
if channels == 2 and rate == 44100:
pre_fun._path_audio_(
inp_path, save_root_ins, save_root_vocal, format0, is_hp3=is_hp3
inp_path, save_root_ins, save_root_vocal, format0
)
need_reformat = 0
done = 1
Expand Down
14 changes: 4 additions & 10 deletions infer/modules/uvr5/vr.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def __init__(self, agg, model_path, device, is_half, tta=False):
self.model = model

def _path_audio_(
self, music_file, ins_root=None, vocal_root=None, format="flac", is_hp3=False
self, music_file, ins_root=None, vocal_root=None, format="flac"
):
if ins_root is None and vocal_root is None:
return "No save root."
Expand Down Expand Up @@ -123,10 +123,7 @@ def _path_audio_(
else:
wav_instrument = spec_utils.cmb_spectrogram_to_wave(y_spec_m, self.mp)
logger.info("%s instruments done" % name)
if is_hp3 == True:
head = "vocal_"
else:
head = "instrument_"
head = "instrument_"
if format in ["wav", "flac"]:
sf.write(
os.path.join(
Expand All @@ -149,10 +146,7 @@ def _path_audio_(
opt_format_path = path[:-4] + ".%s" % format
downsample_audio(path, opt_format_path, format)
if vocal_root is not None:
if is_hp3 == True:
head = "instrument_"
else:
head = "vocal_"
head = "vocal_"
if self.data["high_end_process"].startswith("mirroring"):
input_high_end_ = spec_utils.mirroring(
self.data["high_end_process"], v_spec_m, input_high_end, self.mp
Expand Down Expand Up @@ -213,7 +207,7 @@ def __init__(self, agg, model_path, device, is_half, tta=False):
self.model = model

def _path_audio_(
self, music_file, vocal_root=None, ins_root=None, format="flac", is_hp3=False
self, music_file, vocal_root=None, ins_root=None, format="flac"
): # 3个VR模型vocal和ins是反的
if ins_root is None and vocal_root is None:
return "No save root."
Expand Down
2 changes: 1 addition & 1 deletion requirements/amd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ joblib>=1.1.0
numba==0.56.4
numpy==1.23.5
scipy
librosa==0.10.2
librosa>=0.10.2
llvmlite==0.39.0
fairseq==0.12.2
faiss-cpu==1.7.3
Expand Down
2 changes: 1 addition & 1 deletion requirements/dml.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ joblib>=1.1.0
numba==0.56.4
numpy==1.23.5
scipy
librosa==0.10.2
librosa>=0.10.2
llvmlite==0.39.0
fairseq==0.12.2
faiss-cpu==1.7.3
Expand Down
2 changes: 1 addition & 1 deletion requirements/ipex.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ joblib>=1.1.0
numba==0.56.4
numpy==1.23.5
scipy
librosa==0.10.2
librosa>=0.10.2
llvmlite==0.39.0
fairseq==0.12.2
faiss-cpu==1.7.3
Expand Down
2 changes: 1 addition & 1 deletion requirements/main.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ joblib>=1.1.0
numba
numpy==1.23.5
scipy
librosa==0.10.2
librosa>=0.10.2
llvmlite
fairseq
faiss-cpu
Expand Down
2 changes: 1 addition & 1 deletion requirements/py311.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ joblib>=1.1.0
numba
numpy
scipy
librosa==0.10.2
librosa>=0.10.2
llvmlite
fairseq @ git+https://github.com/One-sixth/fairseq.git
faiss-cpu
Expand Down

0 comments on commit ba5572b

Please sign in to comment.