mirror of
https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI.git
synced 2026-01-19 18:41:52 +00:00
rewrite infer_cli
This commit is contained in:
@@ -16,7 +16,7 @@ from configs.config import Config
|
||||
from infer.modules.vc.modules import VC
|
||||
|
||||
|
||||
def args() -> tuple:
|
||||
def arg_parse() -> tuple:
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--f0up_key", type=int, default=0)
|
||||
parser.add_argument("--input_path", type=str, help="input path")
|
||||
@@ -39,6 +39,12 @@ def args() -> tuple:
|
||||
|
||||
|
||||
def main():
|
||||
load_dotenv()
|
||||
args = arg_parse()
|
||||
config = Config()
|
||||
config.device = args.device if args.device else config.device
|
||||
config.is_half = args.is_half if args.is_half else config.is_half
|
||||
vc = VC(config)
|
||||
vc.get_vc(args.model_name)
|
||||
audios = os.listdir(args.input_path)
|
||||
for file in tq.tqdm(audios):
|
||||
@@ -59,12 +65,8 @@ def main():
|
||||
args.protect,
|
||||
)
|
||||
out_path = os.path.join(args.opt_path, file)
|
||||
wavfile.write(out_path, vc.tgt_sr, wav_opt[1])
|
||||
wavfile.write(out_path, wav_opt[0], wav_opt[1])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
load_dotenv()
|
||||
args = args()
|
||||
config = Config()
|
||||
vc = VC(config)
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user