HwwwH commited on
Commit
2f32cfa
·
verified ·
1 Parent(s): 8df5e16

Move option explanations under the checkboxes

Browse files
Files changed (2) hide show
  1. __pycache__/app.cpython-312.pyc +0 -0
  2. app.py +18 -16
__pycache__/app.cpython-312.pyc CHANGED
Binary files a/__pycache__/app.cpython-312.pyc and b/__pycache__/app.cpython-312.pyc differ
 
app.py CHANGED
@@ -72,16 +72,18 @@ SKIP_VLM = {"image", "header_image", "footer_image"}
72
  COPY = {
73
  "en": {
74
  "language_label": "Language",
75
- "intro": (
76
- "# Document parsing\n"
77
- "Upload an image. When auto-rotate is on, a small skew is corrected and the page "
78
- "is turned to 0°, 90°, 180°, or 270° before layout detection and recognition."
79
- ),
80
  "image": "Image",
81
  "upload": "Drop an image here\n- or -\nclick to upload",
82
  "upright": "Auto-rotate",
 
 
 
 
83
  "seal": "Recognize seals",
84
- "chart": "Chart recognition",
 
 
85
  "parse": "Parse",
86
  "result": "Recognition result",
87
  "parsing": "Parsing…",
@@ -90,15 +92,15 @@ COPY = {
90
  },
91
  "zh": {
92
  "language_label": "语言",
93
- "intro": (
94
- "# 文档解析\n"
95
- "上传一张图片。开启自适应旋转时,先做小角度摆正和 0°/90°/180°/270° 转向,再做版面检测和识别。"
96
- ),
97
  "image": "图片",
98
  "upload": "将图片拖到这里\n- 或 -\n点击上传",
99
  "upright": "自适应旋转",
 
100
  "seal": "印章识别",
 
101
  "chart": "图表识别",
 
102
  "parse": "解析",
103
  "result": "识别结果",
104
  "parsing": "正在解析…",
@@ -411,9 +413,9 @@ if os.environ.get("OCR_SKIP_LAUNCH") != "1":
411
  gr.update(label=text["language_label"]),
412
  gr.update(value=text["intro"]),
413
  gr.update(label=text["image"], placeholder=text["upload"]),
414
- gr.update(label=text["upright"]),
415
- gr.update(label=text["seal"]),
416
- gr.update(label=text["chart"]),
417
  gr.update(value=text["parse"]),
418
  gr.update(label=text["result"]),
419
  )
@@ -431,9 +433,9 @@ if os.environ.get("OCR_SKIP_LAUNCH") != "1":
431
  with gr.Row():
432
  with gr.Column():
433
  image = gr.Image(type="pil", label=english["image"], placeholder=english["upload"])
434
- upright = gr.Checkbox(label=english["upright"], value=True)
435
- recognize_seal = gr.Checkbox(label=english["seal"], value=True)
436
- recognize_chart = gr.Checkbox(label=english["chart"], value=True)
437
  button = gr.Button(english["parse"], variant="primary")
438
  with gr.Column():
439
  progress = gr.HTML()
 
72
  COPY = {
73
  "en": {
74
  "language_label": "Language",
75
+ "intro": "# Document parsing\nUpload an image.",
 
 
 
 
76
  "image": "Image",
77
  "upload": "Drop an image here\n- or -\nclick to upload",
78
  "upright": "Auto-rotate",
79
+ "upright_info": (
80
+ "Corrects a small skew and turns the page to 0°, 90°, 180°, or 270° "
81
+ "before layout detection and recognition."
82
+ ),
83
  "seal": "Recognize seals",
84
+ "seal_info": "Reads the text inside seals. Turn off to skip them.",
85
+ "chart": "Recognize charts",
86
+ "chart_info": "Converts charts into tables. Turn off to skip them.",
87
  "parse": "Parse",
88
  "result": "Recognition result",
89
  "parsing": "Parsing…",
 
92
  },
93
  "zh": {
94
  "language_label": "语言",
95
+ "intro": "# 文档解析\n上传一张图片。",
 
 
 
96
  "image": "图片",
97
  "upload": "将图片拖到这里\n- 或 -\n点击上传",
98
  "upright": "自适应旋转",
99
+ "upright_info": "先做小角度摆正和 0°/90°/180°/270° 转向,再做版面检测和识别。",
100
  "seal": "印章识别",
101
+ "seal_info": "识别印章里的文字。关闭后跳过印章。",
102
  "chart": "图表识别",
103
+ "chart_info": "把图表转成表格。关闭后跳过图表。",
104
  "parse": "解析",
105
  "result": "识别结果",
106
  "parsing": "正在解析…",
 
413
  gr.update(label=text["language_label"]),
414
  gr.update(value=text["intro"]),
415
  gr.update(label=text["image"], placeholder=text["upload"]),
416
+ gr.update(label=text["upright"], info=text["upright_info"]),
417
+ gr.update(label=text["seal"], info=text["seal_info"]),
418
+ gr.update(label=text["chart"], info=text["chart_info"]),
419
  gr.update(value=text["parse"]),
420
  gr.update(label=text["result"]),
421
  )
 
433
  with gr.Row():
434
  with gr.Column():
435
  image = gr.Image(type="pil", label=english["image"], placeholder=english["upload"])
436
+ upright = gr.Checkbox(label=english["upright"], info=english["upright_info"], value=True)
437
+ recognize_seal = gr.Checkbox(label=english["seal"], info=english["seal_info"], value=True)
438
+ recognize_chart = gr.Checkbox(label=english["chart"], info=english["chart_info"], value=True)
439
  button = gr.Button(english["parse"], variant="primary")
440
  with gr.Column():
441
  progress = gr.HTML()