MCPcopy Create free account
hub / github.com/mindee/doctr / parse_args

Function parse_args

scripts/detect_text.py:71–84  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

69
70
71def parse_args():
72 parser = argparse.ArgumentParser(
73 description="DocTR text detection",
74 formatter_class=argparse.ArgumentDefaultsHelpFormatter,
75 )
76 parser.add_argument("path", type=str, help="Path to process: PDF, image, directory")
77 parser.add_argument("--detection", type=str, default="fast_base", help="Text detection model to use for analysis")
78 parser.add_argument("--bin-thresh", type=float, default=0.3, help="Binarization threshold for the detection model.")
79 parser.add_argument("--box-thresh", type=float, default=0.1, help="Threshold for the detection boxes.")
80 parser.add_argument(
81 "--recognition", type=str, default="crnn_vgg16_bn", help="Text recognition model to use for analysis"
82 )
83 parser.add_argument("-f", "--format", choices=["txt", "json", "xml"], default="txt", help="Output format")
84 return parser.parse_args()
85
86
87if __name__ == "__main__":

Callers 1

detect_text.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected