MCPcopy
hub / github.com/JaidedAI/EasyOCR / parse_args

Function parse_args

easyocr/export.py:86–113  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

84
85
86def parse_args():
87 parser = argparse.ArgumentParser()
88 parser.add_argument('-l', '--lang_list',
89 nargs='+', type=str,
90 default=["en"],
91 help='-l en ch_sim ... (language lists for easyocr)')
92 parser.add_argument('-s', '--detector_onnx_save_path', type=str,
93 default="detector_craft.onnx",
94 help="export detector onnx file path ending in .onnx" +
95 "Do not pass in this flag to avoid exporting detector")
96 parser.add_argument('-d', '--dynamic',
97 action='store_true',
98 help="Dynamic input output shapes for detector")
99 parser.add_argument('-is', '--in_shape',
100 nargs='+', type=int,
101 default=[1, 3, 608, 800],
102 help='-is 1 3 608 800 (bsize, channel, height, width)')
103 parser.add_argument('-m', '--model_storage_directory', type=str,
104 help="model storage directory for craft model")
105 parser.add_argument('-u', '--user_network_directory', type=str,
106 help="user model storage directory")
107 args = parser.parse_args()
108 dpath = args.detector_onnx_save_path
109 args.detector_onnx_save_path = None if dpath == "None" else dpath
110 if len(args.in_shape) != 4:
111 raise ValueError(
112 f"Input shape must have four values (bsize, channel, height, width) eg. 1 3 608 800")
113 return args
114
115
116def main():

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…