mirror of
https://github.com/RVC-Boss/GPT-SoVITS.git
synced 2025-04-06 03:57:44 +08:00
Add files via upload
This commit is contained in:
parent
6da486c15d
commit
5a17177342
29
tools/cmd-denoise.py
Normal file
29
tools/cmd-denoise.py
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
import os,argparse
|
||||||
|
|
||||||
|
from modelscope.pipelines import pipeline
|
||||||
|
from modelscope.utils.constant import Tasks
|
||||||
|
from tqdm import tqdm
|
||||||
|
|
||||||
|
path_denoise = 'tools/denoise-model/speech_frcrn_ans_cirm_16k'
|
||||||
|
path_denoise = path_denoise if os.path.exists(path_denoise) else "damo/speech_frcrn_ans_cirm_16k"
|
||||||
|
ans = pipeline(Tasks.acoustic_noise_suppression,model=path_denoise)
|
||||||
|
def execute_denoise(input_folder,output_folder):
|
||||||
|
os.makedirs(output_folder,exist_ok=True)
|
||||||
|
# print(input_folder)
|
||||||
|
# print(list(os.listdir(input_folder).sort()))
|
||||||
|
for name in tqdm(os.listdir(input_folder)):
|
||||||
|
ans("%s/%s"%(input_folder,name),output_path='%s/%s'%(output_folder,name))
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
parser = argparse.ArgumentParser()
|
||||||
|
parser.add_argument("-i", "--input_folder", type=str, required=True,
|
||||||
|
help="Path to the folder containing WAV files.")
|
||||||
|
parser.add_argument("-o", "--output_folder", type=str, required=True,
|
||||||
|
help="Output folder to store transcriptions.")
|
||||||
|
parser.add_argument("-p", "--precision", type=str, default='float16', choices=['float16','float32'],
|
||||||
|
help="fp16 or fp32")#还没接入
|
||||||
|
cmd = parser.parse_args()
|
||||||
|
execute_denoise(
|
||||||
|
input_folder = cmd.input_folder,
|
||||||
|
output_folder = cmd.output_folder,
|
||||||
|
)
|
Loading…
x
Reference in New Issue
Block a user