Liusuthu commited on
Commit
83164e5
·
verified ·
1 Parent(s): 5faa30b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +40 -46
app.py CHANGED
@@ -122,49 +122,45 @@ def clear_dynamic_info():
122
  gr.Textbox(""),
123
  )
124
  ##################################设置各自的app类####################
125
- with gr.Blocks(css="app.css") as video:
126
- with gr.Tab("Dynamic App"):
127
- gr.Markdown(value=DESCRIPTION_DYNAMIC)
128
- with gr.Row():
129
- with gr.Column(scale=2):
130
- input_video = gr.Video(
131
- sources=["webcam", "upload"], elem_classes="video1", format='mp4'
 
 
132
  )
133
- with gr.Row():
134
- clear_btn_dynamic = gr.Button(
135
- value="Clear", interactive=True, scale=1
136
- )
137
- # submit_dynamic = gr.Button(
138
- # value="Submit", interactive=True, scale=1, elem_classes="submit"
139
- # )
140
- submit_and_rank = gr.Button(
141
- value="Score", interactive=True, scale=1, elem_classes="submit"
142
- )
143
- with gr.Column(scale=2, elem_classes="dl4"):
144
- with gr.Row():
145
- output_score = gr.Textbox(label="scores")
146
- output_statistics = gr.Plot(
147
- label="Statistics of emotions", elem_classes="stat"
148
  )
149
- output_audio=gr.Audio(interactive=False)
150
- audio_test_button=gr.Button("分析语音")
151
- out1=gr.Textbox(label="语音分析结果")
152
- out2=gr.Textbox(label="音频情感识别1")
153
- out3=gr.Textbox(label="音频情感识别2")
154
- text_test_button=gr.Button("分析文本")
155
- text_result=gr.Textbox(interactive=False)
156
- gr.Examples(
157
- [
158
- "videos/video1.mp4",
159
- "videos/video2.mp4",
160
- "videos/sample.webm",
161
- "videos/cnm.mp4",
162
- ],
163
- [input_video],
164
- )
 
 
 
 
 
 
165
 
166
- with gr.Tab("Authors"):
167
- gr.Markdown(value=AUTHORS)
168
 
169
  clear_btn_dynamic.click(
170
  fn=clear_dynamic_info,
@@ -232,12 +228,10 @@ with gr.Blocks() as video_all:
232
  with gr.Column(scale=2):
233
  with gr.Row():
234
  output_score = gr.Textbox(label="scores")
235
- with gr.Row():
236
- output_statistics = gr.Plot(
237
- label="Statistics of emotions", elem_classes="stat",visible=False,
238
- )
239
- with gr.Row():
240
- output_audio=gr.Audio(interactive=False)
241
 
242
  clear_1.click(
243
  fn=clear_video,
 
122
  gr.Textbox(""),
123
  )
124
  ##################################设置各自的app类####################
125
+ with gr.Blocks(css="app.css") as video:
126
+ with gr.Row():
127
+ with gr.Column(scale=2):
128
+ input_video = gr.Video(
129
+ sources=["webcam", "upload"], elem_classes="video1", format='mp4'
130
+ )
131
+ with gr.Row():
132
+ clear_btn_dynamic = gr.Button(
133
+ value="Clear", interactive=True, scale=1
134
  )
135
+ # submit_dynamic = gr.Button(
136
+ # value="Submit", interactive=True, scale=1, elem_classes="submit"
137
+ # )
138
+ submit_and_rank = gr.Button(
139
+ value="Score", interactive=True, scale=1, elem_classes="submit"
 
 
 
 
 
 
 
 
 
 
140
  )
141
+ with gr.Column(scale=2, elem_classes="dl4"):
142
+ with gr.Row():
143
+ output_score = gr.Textbox(label="scores")
144
+ output_statistics = gr.Plot(
145
+ label="Statistics of emotions", elem_classes="stat"
146
+ )
147
+ output_audio=gr.Audio(interactive=False)
148
+ audio_test_button=gr.Button("分析语音")
149
+ out1=gr.Textbox(label="语音分析结果")
150
+ out2=gr.Textbox(label="音频情感识别1")
151
+ out3=gr.Textbox(label="音频情感识别2")
152
+ text_test_button=gr.Button("分析文本")
153
+ text_result=gr.Textbox(interactive=False)
154
+ gr.Examples(
155
+ [
156
+ "videos/video1.mp4",
157
+ "videos/video2.mp4",
158
+ "videos/sample.webm",
159
+ "videos/cnm.mp4",
160
+ ],
161
+ [input_video],
162
+ )
163
 
 
 
164
 
165
  clear_btn_dynamic.click(
166
  fn=clear_dynamic_info,
 
228
  with gr.Column(scale=2):
229
  with gr.Row():
230
  output_score = gr.Textbox(label="scores")
231
+ output_statistics = gr.Plot(
232
+ label="Statistics of emotions", elem_classes="stat",visible=True,
233
+ )
234
+ output_audio=gr.Audio(interactive=False)
 
 
235
 
236
  clear_1.click(
237
  fn=clear_video,