MCPcopy
hub / github.com/sml2h3/ddddocr / build_parser

Function build_parser

examples/basic_ocr.py:23–47  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21
22
23def build_parser() -> argparse.ArgumentParser:
24 parser = argparse.ArgumentParser(description="DdddOcr 本地识别示例")
25 parser.add_argument("image", type=Path, help="待识别图片路径")
26 parser.add_argument(
27 "--probability",
28 action="store_true",
29 help="输出每一列的概率分布",
30 )
31 parser.add_argument(
32 "--colors",
33 nargs="*",
34 default=(),
35 help="可选:指定需要保留的颜色,例如 red green",
36 )
37 parser.add_argument(
38 "--beta",
39 action="store_true",
40 help="使用新版 beta OCR 模型",
41 )
42 parser.add_argument(
43 "--old",
44 action="store_true",
45 help="使用旧版 OCR 模型 (beta=False 时有效)",
46 )
47 return parser
48
49
50def main() -> int:

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…