Liusuthu commited on
Commit
6add720
·
verified ·
1 Parent(s): 970cddc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -19
app.py CHANGED
@@ -6,7 +6,7 @@ import soundfile as sf
6
  import torchaudio
7
  from speechbrain.pretrained.interfaces import foreign_class
8
 
9
- from app_utils import video_score
10
  from authors import AUTHORS
11
 
12
  # Importing necessary components for the Gradio app
@@ -121,14 +121,6 @@ def clear_dynamic_info():
121
  gr.Plot(value=None),
122
  gr.Textbox(""),
123
  )
124
-
125
- def clear_video():
126
- return (
127
- gr.Video(value=None),
128
- gr.Textbox(""),
129
- gr.Textbox(""),
130
- gr.Textbox("")
131
- )
132
  ##################################设置各自的app类####################
133
  with gr.Blocks(css="app.css") as video:
134
  with gr.Tab("Dynamic App"):
@@ -215,6 +207,15 @@ speech = gr.Interface(
215
  ],
216
  )
217
  ############################################################
 
 
 
 
 
 
 
 
 
218
  with gr.Blocks() as video_all:
219
  with gr.Row():
220
  with gr.Column(scale=2):
@@ -230,24 +231,24 @@ with gr.Blocks() as video_all:
230
  )
231
  with gr.Column(scale=2):
232
  with gr.Row():
233
- score1=gr.Textbox(interactive=False,label="score1")
234
- with gr.Row():
235
- score2=gr.Textbox(interactive=False,label="score2")
236
- with gr.Row():
237
- result3=gr.Textbox(interactive=False)
238
 
239
  clear_1.click(
240
  fn=clear_video,
241
  inputs=[],
242
- outputs=[input_video,score1,score2,result3]
243
  )
244
  submit_1.click(
245
- fn=video_score,
246
  inputs=[input_video],
247
  outputs=[
248
- score1,
249
- score2,
250
- result3
251
  ],
252
  )
253
  ###################################################################
 
6
  import torchaudio
7
  from speechbrain.pretrained.interfaces import foreign_class
8
 
9
+ from app_utils import video_score,video_test
10
  from authors import AUTHORS
11
 
12
  # Importing necessary components for the Gradio app
 
121
  gr.Plot(value=None),
122
  gr.Textbox(""),
123
  )
 
 
 
 
 
 
 
 
124
  ##################################设置各自的app类####################
125
  with gr.Blocks(css="app.css") as video:
126
  with gr.Tab("Dynamic App"):
 
207
  ],
208
  )
209
  ############################################################
210
+ def clear_video():
211
+ return (
212
+ gr.Video(value=None),
213
+ gr.Textbox(""),
214
+ gr.Plot(value=None),
215
+ gr.Audio(value=None),
216
+ )
217
+
218
+
219
  with gr.Blocks() as video_all:
220
  with gr.Row():
221
  with gr.Column(scale=2):
 
231
  )
232
  with gr.Column(scale=2):
233
  with gr.Row():
234
+ output_score = gr.Textbox(label="scores")
235
+ output_statistics = gr.Plot(
236
+ label="Statistics of emotions", elem_classes="stat",visible=False,
237
+ )
238
+ output_audio=gr.Audio(interactive=False)
239
 
240
  clear_1.click(
241
  fn=clear_video,
242
  inputs=[],
243
+ outputs=[input_video,output_score,output_statistics,output_audio]
244
  )
245
  submit_1.click(
246
+ fn=video_test,
247
  inputs=[input_video],
248
  outputs=[
249
+ output_score,
250
+ output_statistics,
251
+ output_audio,
252
  ],
253
  )
254
  ###################################################################