Spaces:
Build error
Build error
import gradio as gr | |
from inference import infer | |
import numpy as np | |
spkdict=np.arange(175).tolist() | |
spkdict=['speaker'+str(spk) for spk in spkdict] | |
app = gr.Blocks() | |
with app: | |
with gr.Tabs(): | |
with gr.TabItem("Basic"): | |
gr.Markdown(value=""" | |
本模型为混合了aishell3(174说话人,共约80+h)和opencpop(1说话人,5+h)用A100单卡在60batchsize下训练了350左右epoch得到的。\n | |
模型对于纯粹的语音转换效果尚可,对于歌唱音频则只能在对应说话人音域范围内才有较好效果。且由于aishell3数据占比过大,训练epoch不足,导致opencpop说话人的高音部分发挥较差。\n | |
模型中各说话人的适宜中心音域分别为:\n | |
aishell3(0-173号) 女性说话:A3,男性说话:C3\n | |
opencpop(174号) 女性唱歌:C4(超过C5基本失真)\n | |
如果转换通常说话音频,需要参考上面范围调key至目标说话人中心音域附近(如男性说话专为女性说话,key=8,反过来为-8)\n | |
如果源音频为部分虚拟主播音频,通常音调会高于正常女性说话范围,可达到F4-A4左右,请适当降调\n | |
""") | |
sid = gr.Dropdown(label="说话人",choices=spkdict, value='speaker0') | |
vc_audio = gr.Audio(label="上传音频,建议小于2分钟") | |
vc_record = gr.Audio(source="microphone", label="或者录制你的声音", type="numpy") | |
vc_transform = gr.Number(label="调key(按照十二平均律确定的半音,一整个8度就是12)",value=0) | |
vc_submit = gr.Button("转换", variant="primary") | |
vc_output1 = gr.Textbox(label="Output Message") | |
vc_output2 = gr.Audio(label="Output Audio") | |
vc_submit.click(infer, [vc_audio,vc_record,sid, vc_transform], [vc_output1, vc_output2]) | |
app.launch() |