Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -130,79 +130,79 @@ def clear_video():
|
|
130 |
gr.Textbox("")
|
131 |
)
|
132 |
##################################่ฎพ็ฝฎๅ่ช็app็ฑป####################
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
#
|
146 |
-
#
|
147 |
-
#
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
|
174 |
-
|
175 |
-
|
176 |
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
|
207 |
####################################
|
208 |
speech = gr.Interface(
|
@@ -307,8 +307,8 @@ with gr.Blocks() as text_all:
|
|
307 |
with gr.Blocks() as app:
|
308 |
with gr.Tab("่ฏญ้ณ"):
|
309 |
speech.render()
|
310 |
-
|
311 |
-
|
312 |
with gr.Tab("่ง้ข้ๆๆๅ"):
|
313 |
video_all.render()
|
314 |
with gr.Tab("่ฏญ้ณ้ๆๆๅ"):
|
|
|
130 |
gr.Textbox("")
|
131 |
)
|
132 |
##################################่ฎพ็ฝฎๅ่ช็app็ฑป####################
|
133 |
+
with gr.Blocks(css="app.css") as video:
|
134 |
+
with gr.Tab("Dynamic App"):
|
135 |
+
gr.Markdown(value=DESCRIPTION_DYNAMIC)
|
136 |
+
with gr.Row():
|
137 |
+
with gr.Column(scale=2):
|
138 |
+
input_video = gr.Video(
|
139 |
+
sources=["webcam", "upload"], elem_classes="video1", format='mp4'
|
140 |
+
)
|
141 |
+
with gr.Row():
|
142 |
+
clear_btn_dynamic = gr.Button(
|
143 |
+
value="Clear", interactive=True, scale=1
|
144 |
+
)
|
145 |
+
# submit_dynamic = gr.Button(
|
146 |
+
# value="Submit", interactive=True, scale=1, elem_classes="submit"
|
147 |
+
# )
|
148 |
+
submit_and_rank = gr.Button(
|
149 |
+
value="Score", interactive=True, scale=1, elem_classes="submit"
|
150 |
+
)
|
151 |
+
with gr.Column(scale=2, elem_classes="dl4"):
|
152 |
+
with gr.Row():
|
153 |
+
output_score = gr.Textbox(label="scores")
|
154 |
+
output_statistics = gr.Plot(
|
155 |
+
label="Statistics of emotions", elem_classes="stat"
|
156 |
+
)
|
157 |
+
output_audio=gr.Audio(interactive=False)
|
158 |
+
audio_test_button=gr.Button("ๅๆ่ฏญ้ณ")
|
159 |
+
out1=gr.Textbox(label="่ฏญ้ณๅๆ็ปๆ")
|
160 |
+
out2=gr.Textbox(label="้ณ้ขๆ
ๆ่ฏๅซ1")
|
161 |
+
out3=gr.Textbox(label="้ณ้ขๆ
ๆ่ฏๅซ2")
|
162 |
+
text_test_button=gr.Button("ๅๆๆๆฌ")
|
163 |
+
text_result=gr.Textbox(interactive=False)
|
164 |
+
gr.Examples(
|
165 |
+
[
|
166 |
+
"videos/video1.mp4",
|
167 |
+
"videos/video2.mp4",
|
168 |
+
"videos/sample.webm",
|
169 |
+
"videos/cnm.mp4",
|
170 |
+
],
|
171 |
+
[input_video],
|
172 |
+
)
|
173 |
|
174 |
+
with gr.Tab("Authors"):
|
175 |
+
gr.Markdown(value=AUTHORS)
|
176 |
|
177 |
+
clear_btn_dynamic.click(
|
178 |
+
fn=clear_dynamic_info,
|
179 |
+
inputs=[],
|
180 |
+
outputs=[
|
181 |
+
input_video,
|
182 |
+
output_statistics,
|
183 |
+
output_score,
|
184 |
+
],
|
185 |
+
queue=True,
|
186 |
+
)
|
187 |
+
submit_and_rank.click(
|
188 |
+
fn=preprocess_video_and_rank,
|
189 |
+
inputs=input_video,
|
190 |
+
outputs=[
|
191 |
+
output_statistics,
|
192 |
+
output_score,
|
193 |
+
output_audio,
|
194 |
+
],
|
195 |
+
)
|
196 |
+
audio_test_button.click(
|
197 |
+
fn=classify_continuous,
|
198 |
+
inputs=output_audio,
|
199 |
+
outputs=[out1,out2,out3]
|
200 |
+
)
|
201 |
+
text_test_button.click(
|
202 |
+
fn=text_api,
|
203 |
+
inputs=out1,
|
204 |
+
outputs=text_result,
|
205 |
+
)
|
206 |
|
207 |
####################################
|
208 |
speech = gr.Interface(
|
|
|
307 |
with gr.Blocks() as app:
|
308 |
with gr.Tab("่ฏญ้ณ"):
|
309 |
speech.render()
|
310 |
+
with gr.Tab("่ง้ข"):
|
311 |
+
video.render()
|
312 |
with gr.Tab("่ง้ข้ๆๆๅ"):
|
313 |
video_all.render()
|
314 |
with gr.Tab("่ฏญ้ณ้ๆๆๅ"):
|