Spaces:
Runtime error
Runtime error
Commit ·
99519b7
1
Parent(s): 844ee1d
Update app.py
Browse files50 unmodified lines5152535455565758596061629 unmodified lines7273747576777850 unmodified lines# demoaudio, sr = librosa.load(audio_path)key = tran # 音高调整,支持正负(半音)# 加速倍数wav_gen='queeeeee.wav'# Show the spinner and run the run_clip function inside the 'with' blockf0_tst, f0_pred, audio = run_clip(svc_model, file_path=audio_path, key=key, acc=pndm_speedup, use_crepe=True, use_pe=True, thre=0.05,use_gt_mel=False, add_noise_step=500, project_name=project_name, out_path=wav_gen)f0_gen,_=get_pitch_parselmouth(*svc_model.vocoder.wav2spec(wav_gen),hparams)f0_tst[f0_tst==0]=np.nan#ground truth f0f0_pred[f0_pred==0]=np.nan#f0 pe predicted9 unmodified lines#plt.axhline(librosa.note_to_hz('A#5'),ls=":",c="black")plt.savefig('./temp.png')return "Success", (hparams['audio_sample_rate'], audio), gr.Image.update("temp.png")app = gr.Blocks()50 unmodified lines5152535455565758596061629 unmodified lines7273747576777850 unmodified lines# demoaudio, sr = librosa.load(audio_path)key = tran # 音高调整,支持正负(半音)# 加速倍数wav_gen='./output.wav'# Show the spinner and run the run_clip function inside the 'with' blockf0_tst, f0_pred, audio = run_clip(svc_model, file_path=audio_path, key=key, acc=pndm_speedup, use_crepe=True, use_pe=True, thre=0.05,use_gt_mel=False, add_noise_step=500, project_name=project_name, out_path=wav_gen)audio, sr = librosa.load(wav_gen)f0_gen,_=get_pitch_parselmouth(*svc_model.vocoder.wav2spec(wav_gen),hparams)f0_tst[f0_tst==0]=np.nan#ground truth f0f0_pred[f0_pred==0]=np.nan#f0 pe predicted9 unmodified lines#plt.axhline(librosa.note_to_hz('A#5'),ls=":",c="black")plt.savefig('./temp.png')return "Success", (sr, audio), gr.Image.update("temp.png") # hparams['audio_sample_rate']app = gr.Blocks()
app.py+3-3