SWHL commited on
Commit
f2678df
1 Parent(s): d67e4e5
Files changed (2) hide show
  1. app.py +8 -5
  2. requirements.txt +1 -1
app.py CHANGED
@@ -1,7 +1,7 @@
1
  # -*- encoding: utf-8 -*-
2
  import os
3
 
4
- os.system('pip install -r requirements.txt')
5
 
6
  import math
7
  import random
@@ -101,7 +101,7 @@ def inference(img_path, box_thresh=0.5, unclip_ratio=1.6, text_score=0.5):
101
 
102
 
103
  title = 'RapidOCR Demo (捷智OCR)'
104
- description = 'Gradio demo for RapidOCR. Github Repo: https://github.com/RapidAI/RapidOCR'
105
  article = "<p style='text-align: center'> Completely open source, free and support offline deployment of multi-platform and multi-language OCR SDK <a href='https://github.com/RapidAI/RapidOCR'>Github Repo</a></p>"
106
  css = ".output_image, .input_image {height: 40rem !important; width: 100% !important;}"
107
  examples = [['images/1.jpg']]
@@ -113,11 +113,14 @@ gr.Interface(
113
  inputs=[
114
  gr.inputs.Image(type='filepath', label='Input'),
115
  gr.Slider(minimum=0, maximum=1.0, value=0.5,
116
- label='box_thresh', step=0.1),
 
117
  gr.Slider(minimum=1.5, maximum=2.0, value=1.6,
118
- label='unclip_ratio', step=0.1),
 
119
  gr.Slider(minimum=0, maximum=1.0, value=0.5,
120
- label='text_score', step=0.1),
 
121
  ],
122
  outputs=[
123
  gr.outputs.Image(type='filepath', label='Output_image'),
 
1
  # -*- encoding: utf-8 -*-
2
  import os
3
 
4
+ # os.system('pip install -r requirements.txt')
5
 
6
  import math
7
  import random
 
101
 
102
 
103
  title = 'RapidOCR Demo (捷智OCR)'
104
+ description = 'Github Repo: [RapidOCR](https://github.com/RapidAI/RapidOCR)\nDocs: [Docs](https://rapidocr.rtfd.io/)\nParameters 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)'
105
  article = "<p style='text-align: center'> Completely open source, free and support offline deployment of multi-platform and multi-language OCR SDK <a href='https://github.com/RapidAI/RapidOCR'>Github Repo</a></p>"
106
  css = ".output_image, .input_image {height: 40rem !important; width: 100% !important;}"
107
  examples = [['images/1.jpg']]
 
113
  inputs=[
114
  gr.inputs.Image(type='filepath', label='Input'),
115
  gr.Slider(minimum=0, maximum=1.0, value=0.5,
116
+ label='box_thresh', step=0.1,
117
+ info='检测到的框是文本的概率,值越大,框中是文本的概率就越大。存在漏检时,调低该值。取值范围:[0, 1.0]'),
118
  gr.Slider(minimum=1.5, maximum=2.0, value=1.6,
119
+ label='unclip_ratio', step=0.1,
120
+ info='控制文本检测框的大小,值越大,检测框整体越大。在出现框截断文字的情况,调大该值。取值范围:[1.5, 2.0]'),
121
  gr.Slider(minimum=0, maximum=1.0, value=0.5,
122
+ label='text_score', step=0.1,
123
+ info='文本识别结果是正确的置信度,值越大,显示出的识别结果更准确。存在漏检时,调低该值。取值范围:[0, 1.0]'),
124
  ],
125
  outputs=[
126
  gr.outputs.Image(type='filepath', label='Output_image'),
requirements.txt CHANGED
@@ -1,3 +1,3 @@
1
  Gradio==3.14.0
2
  Pillow
3
- rapidocr_onnxruntime==1.1.20
 
1
  Gradio==3.14.0
2
  Pillow
3
+ rapidocr_onnxruntime