Format code (#455)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
github-actions[bot]
2023-06-06 14:35:35 +00:00
committed by GitHub
parent 6f1bc7d683
commit 52c97ed464
6 changed files with 63 additions and 47 deletions

View File

@@ -206,25 +206,28 @@ class Predictor:
mix = mix.T
sources = self.demix(mix.T)
opt = sources[0].T
if(format in ["wav", "flac"]):
sf.write("%s/%s_main_vocal.%s" % (vocal_root, basename, format), mix - opt, rate)
if format in ["wav", "flac"]:
sf.write(
"%s/%s_main_vocal.%s" % (vocal_root, basename, format), mix - opt, rate
)
sf.write("%s/%s_others.%s" % (others_root, basename, format), opt, rate)
else:
path_vocal="%s/%s_main_vocal.wav" % (vocal_root, basename)
path_other="%s/%s_others.wav" % (others_root, basename)
path_vocal = "%s/%s_main_vocal.wav" % (vocal_root, basename)
path_other = "%s/%s_others.wav" % (others_root, basename)
sf.write(path_vocal, mix - opt, rate)
sf.write(path_other, opt, rate)
if (os.path.exists(path_vocal)):
if os.path.exists(path_vocal):
os.system(
"ffmpeg -i %s -vn %s -q:a 2 -y"
% (path_vocal, path_vocal[:-4] + ".%s" % format)
)
if (os.path.exists(path_other)):
if os.path.exists(path_other):
os.system(
"ffmpeg -i %s -vn %s -q:a 2 -y"
% (path_other, path_other[:-4] + ".%s" % format)
)
class MDXNetDereverb:
def __init__(self, chunks):
self.onnx = "uvr5_weights/onnx_dereverb_By_FoxJoy"