Last active
February 4, 2025 10:51
-
-
Save tqk2811/21134fb37387fae47eae99ef02af7945 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import os | |
import numpy as np | |
import argparse | |
from modules.utils.paths import (WHISPER_MODELS_DIR, DIARIZATION_MODELS_DIR, OUTPUT_DIR, DEFAULT_PARAMETERS_CONFIG_PATH, | |
UVR_MODELS_DIR) | |
from modules.uvr.music_separator import MusicSeparator | |
parser = argparse.ArgumentParser() | |
parser.add_argument('--file_input', type=str, help='file path', required=True) | |
parser.add_argument('--output_dir', type=str, help='output dir', required=True) | |
parser.add_argument('--model_dir', type=str, default=UVR_MODELS_DIR) | |
_args = parser.parse_args() | |
ms = MusicSeparator( | |
model_dir = _args.model_dir, | |
output_dir = _args.output_dir | |
) | |
parser.add_argument('--device', type=str, default = ms.available_devices[0], help='chose ' + ms.available_devices, choices = ms.available_devices) | |
parser.add_argument('--model_name', type=str, default = ms.available_models[0], help='chose ' + ms.available_models, choices = ms.available_models) | |
_args = parser.parse_args() | |
instrumental, voice, file_paths = ms.separate( | |
audio=sys.argv[1], | |
model_name = _args.model_name, | |
device = _args.device, | |
save_file=True | |
) | |
print(file_paths,flush=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment