Spaces:
Runtime error
Runtime error
Commit
·
9fc70e9
1
Parent(s):
600a24f
Update app.py
Browse files
app.py
CHANGED
@@ -63,14 +63,15 @@ def vc_fn(sid, audio_record, audio_upload, tran, pndm_speedup=20):
|
|
63 |
f0_pred[f0_pred==0]=np.nan#f0 pe predicted
|
64 |
f0_gen[f0_gen==0]=np.nan#f0 generated
|
65 |
fig=plt.figure(figsize=[15,5])
|
66 |
-
plt.plot(np.arange(0,len(f0_tst)),f0_tst,color='black')
|
67 |
-
plt.plot(np.arange(0,len(f0_pred)),f0_pred,color='orange')
|
68 |
-
plt.plot(np.arange(0,len(f0_gen)),f0_gen,color='red')
|
69 |
-
plt.axhline(librosa.note_to_hz('C4'),ls=":",c="blue")
|
70 |
-
plt.axhline(librosa.note_to_hz('G4'),ls=":",c="green")
|
71 |
-
plt.axhline(librosa.note_to_hz('C5'),ls=":",c="orange")
|
72 |
-
plt.axhline(librosa.note_to_hz('F#5'),ls=":",c="red")
|
73 |
-
#plt.axhline(librosa.note_to_hz('A#5'),ls=":",c="black")
|
|
|
74 |
plt.savefig('./temp.png')
|
75 |
|
76 |
return "Success", (sr, audio), gr.Image.update("temp.png") # hparams['audio_sample_rate']
|
@@ -99,8 +100,7 @@ with app:
|
|
99 |
无用信息
|
100 |
""")
|
101 |
out_message = gr.Textbox(label="Output")
|
102 |
-
gr.Markdown(value="""f0
|
103 |
-
若**只看见橙色**,说明蓝色曲线被覆盖,转换效果较好
|
104 |
""")
|
105 |
f0_image = gr.Image(label="f0曲线")
|
106 |
vc_submit.click(vc_fn, [speaker_id, record_input, upload_input, vc_transform, vc_speedup],
|
|
|
63 |
f0_pred[f0_pred==0]=np.nan#f0 pe predicted
|
64 |
f0_gen[f0_gen==0]=np.nan#f0 generated
|
65 |
fig=plt.figure(figsize=[15,5])
|
66 |
+
plt.plot(np.arange(0,len(f0_tst)),f0_tst,color='black',label="f0_tst")
|
67 |
+
plt.plot(np.arange(0,len(f0_pred)),f0_pred,color='orange',label="f0_pred")
|
68 |
+
plt.plot(np.arange(0,len(f0_gen)),f0_gen,color='red',label="f0_gen")
|
69 |
+
plt.axhline(librosa.note_to_hz('C4'),ls=":",c="blue",label="C4")
|
70 |
+
plt.axhline(librosa.note_to_hz('G4'),ls=":",c="green",label="G4")
|
71 |
+
plt.axhline(librosa.note_to_hz('C5'),ls=":",c="orange",label="C5")
|
72 |
+
plt.axhline(librosa.note_to_hz('F#5'),ls=":",c="red",label="F#5")
|
73 |
+
#plt.axhline(librosa.note_to_hz('A#5'),ls=":",c="black",label="分割线")
|
74 |
+
plt.legend()
|
75 |
plt.savefig('./temp.png')
|
76 |
|
77 |
return "Success", (sr, audio), gr.Image.update("temp.png") # hparams['audio_sample_rate']
|
|
|
100 |
无用信息
|
101 |
""")
|
102 |
out_message = gr.Textbox(label="Output")
|
103 |
+
gr.Markdown(value="""f0曲线可以直观的显示跑调情况:
|
|
|
104 |
""")
|
105 |
f0_image = gr.Image(label="f0曲线")
|
106 |
vc_submit.click(vc_fn, [speaker_id, record_input, upload_input, vc_transform, vc_speedup],
|