Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -104,13 +104,13 @@ examples = [['images/1.jpg']]
|
|
| 104 |
|
| 105 |
with gr.Blocks(title='RapidOCR') as demo:
|
| 106 |
gr.Markdown("""
|
| 107 |
-
<
|
| 108 |
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
with gr.Box():
|
| 115 |
with gr.Row():
|
| 116 |
box_thresh = gr.Slider(minimum=0, maximum=1.0, value=0.5,
|
|
@@ -125,10 +125,11 @@ with gr.Blocks(title='RapidOCR') as demo:
|
|
| 125 |
label='text_score', step=0.1,
|
| 126 |
interactive=True,
|
| 127 |
info='[0, 1.0]')
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
|
|
|
| 132 |
button = gr.Button('Submit')
|
| 133 |
button.click(fn=inference,
|
| 134 |
inputs=[input_img, box_thresh, unclip_ratio, text_score],
|
|
|
|
| 104 |
|
| 105 |
with gr.Blocks(title='RapidOCR') as demo:
|
| 106 |
gr.Markdown("""
|
| 107 |
+
<center><a href="https://github.com/RapidAI/RapidOCR" target="_blank"><img src="https://raw.githubusercontent.com/RapidAI/RapidOCR/main/assets/RapidOCR_LOGO.png" width="30%"></a></center>
|
| 108 |
|
| 109 |
+
## Docs: [Docs](https://rapidocr.rtfd.io/)
|
| 110 |
+
## Parameters docs: [link](https://github.com/RapidAI/RapidOCR/tree/main/python#configyaml%E4%B8%AD%E5%B8%B8%E7%94%A8%E5%8F%82%E6%95%B0%E4%BB%8B%E7%BB%8D)
|
| 111 |
+
#### `box_thresh`: 检测到的框是文本的概率,值越大,框中是文本的概率就越大。存在漏检时,调低该值。
|
| 112 |
+
#### `unclip_ratio`: 控制文本检测框的大小,值越大,检测框整体越大。在出现框截断文字的情况,调大该值。
|
| 113 |
+
#### `text_score`: 文本识别结果是正确的置信度,值越大,显示出的识别结果更准确。存在漏检时,调低该值。""")
|
| 114 |
with gr.Box():
|
| 115 |
with gr.Row():
|
| 116 |
box_thresh = gr.Slider(minimum=0, maximum=1.0, value=0.5,
|
|
|
|
| 125 |
label='text_score', step=0.1,
|
| 126 |
interactive=True,
|
| 127 |
info='[0, 1.0]')
|
| 128 |
+
with gr.Row():
|
| 129 |
+
input_img = gr.Image(type='filepath', label='Input')
|
| 130 |
+
with gr.Column(scale=2):
|
| 131 |
+
out_img = gr.Image(type='filepath', label='Output_image')
|
| 132 |
+
out_txt = gr.outputs.Textbox(type='text', label='Output_text')
|
| 133 |
button = gr.Button('Submit')
|
| 134 |
button.click(fn=inference,
|
| 135 |
inputs=[input_img, box_thresh, unclip_ratio, text_score],
|