Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -67,7 +67,7 @@ def fx6(img, lang):
|
|
67 |
font_path='simfang.ttf')
|
68 |
im_show = Image.fromarray(im_show)
|
69 |
im_show.save('result.jpg')
|
70 |
-
return 'result.jpg'
|
71 |
|
72 |
def fx7(x,y):
|
73 |
res=re.findall(r'{0}'.format(y),x)
|
@@ -106,7 +106,7 @@ with demo:
|
|
106 |
gr.HTML(value=ht_text,label="在线版演示",show_label=True)
|
107 |
with gr.TabItem("OCR识别"):
|
108 |
ocr_input=[gr.Image(type='file', label='请提供你需要识别的照片'),gr.Dropdown(choices=['中文','英文','法文','德文','韩文','日文'], type="value", default='中文', label='请选择需要识别的语言')]
|
109 |
-
ocr_output=gr.Image(type='file', label='识别结果')
|
110 |
ocr_button = gr.Button("开始ocr识别")
|
111 |
with gr.TabItem("正则处理"):
|
112 |
with gr.Row():
|
@@ -126,7 +126,7 @@ with demo:
|
|
126 |
dq_button.click(fx3, inputs=file_input, outputs=table_output,api_name="df")
|
127 |
tts_button.click(fx4, inputs=TS_input, outputs=audio_output)
|
128 |
pva_button.click(fx5, inputs=[],outputs=pva_output)
|
129 |
-
ocr_button.click(fx6,inputs=ocr_input,outputs=ocr_output)
|
130 |
zz1_button.click(fx7,inputs=zz1_input,outputs=zz1_output,api_name="zzpp")
|
131 |
zz2_button.click(fx8,inputs=zz2_input,outputs=zz2_output,api_name="zzth")
|
132 |
|
|
|
67 |
font_path='simfang.ttf')
|
68 |
im_show = Image.fromarray(im_show)
|
69 |
im_show.save('result.jpg')
|
70 |
+
return 'result.jpg',txts
|
71 |
|
72 |
def fx7(x,y):
|
73 |
res=re.findall(r'{0}'.format(y),x)
|
|
|
106 |
gr.HTML(value=ht_text,label="在线版演示",show_label=True)
|
107 |
with gr.TabItem("OCR识别"):
|
108 |
ocr_input=[gr.Image(type='file', label='请提供你需要识别的照片'),gr.Dropdown(choices=['中文','英文','法文','德文','韩文','日文'], type="value", default='中文', label='请选择需要识别的语言')]
|
109 |
+
ocr_output=[gr.Image(type='file', label='识别结果'),gr.Dataframe(label="识别信息",show_label=True)]
|
110 |
ocr_button = gr.Button("开始ocr识别")
|
111 |
with gr.TabItem("正则处理"):
|
112 |
with gr.Row():
|
|
|
126 |
dq_button.click(fx3, inputs=file_input, outputs=table_output,api_name="df")
|
127 |
tts_button.click(fx4, inputs=TS_input, outputs=audio_output)
|
128 |
pva_button.click(fx5, inputs=[],outputs=pva_output)
|
129 |
+
ocr_button.click(fx6,inputs=ocr_input,outputs=ocr_output,api_name="ocr")
|
130 |
zz1_button.click(fx7,inputs=zz1_input,outputs=zz1_output,api_name="zzpp")
|
131 |
zz2_button.click(fx8,inputs=zz2_input,outputs=zz2_output,api_name="zzth")
|
132 |
|