Spaces:
Runtime error
Runtime error
Upload test3.py
Browse files
test3.py
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
#from gradio_test_01 import dec_video
|
3 |
+
|
4 |
+
|
5 |
+
#vr = '/tmp/gradio/3342a56acc37b5a8b6d2d3453d8f4c3bd707753d/video_demo_02.mp4'
|
6 |
+
|
7 |
+
# 修改函数
|
8 |
+
def audioToText1(file):
|
9 |
+
return 1
|
10 |
+
def audioToText2(file):
|
11 |
+
return 2
|
12 |
+
def audioToText3(file):
|
13 |
+
return 3
|
14 |
+
|
15 |
+
with gr.Blocks() as demo:
|
16 |
+
# 使用 Markdown 输出一句话或标题
|
17 |
+
gr.Markdown(
|
18 |
+
"""
|
19 |
+
# 诈骗内容检测
|
20 |
+
视频 音频 文本
|
21 |
+
""")
|
22 |
+
with gr.Row():
|
23 |
+
with gr.Column(scale=1):
|
24 |
+
# 设置输入组件
|
25 |
+
name = gr.Video(label="诈骗检测")
|
26 |
+
with gr.Column(scale=1):
|
27 |
+
# 设置输出组件
|
28 |
+
output1 = gr.Textbox(label="虚假视频概率")
|
29 |
+
output2 = gr.Textbox(label="虚假音频概率")
|
30 |
+
output3 = gr.Textbox(label="诈骗文本概率")
|
31 |
+
# 设置按钮
|
32 |
+
greet_btn = gr.Button("保存文件")
|
33 |
+
# 设置按钮点击事件
|
34 |
+
greet_btn.click(fn=audioToText1, inputs=name, outputs=output1)
|
35 |
+
greet_btn.click(fn=audioToText2, inputs=name, outputs=output2)
|
36 |
+
greet_btn.click(fn=audioToText3, inputs=name, outputs=output3)
|
37 |
+
|
38 |
+
demo.launch(share=True, show_error = True)
|