You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/eynollah/cli/cli_ocr.py
+1-20Lines changed: 1 addition & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -59,12 +59,6 @@
59
59
is_flag=True,
60
60
help="if this parameter set to true, transformer ocr will be applied, otherwise cnn_rnn model.",
61
61
)
62
-
@click.option(
63
-
"--export_textline_images_and_text",
64
-
"-etit/-noetit",
65
-
is_flag=True,
66
-
help="if this parameter set to true, images and text in xml will be exported into output dir. This files can be used for training a OCR engine.",
67
-
)
68
62
@click.option(
69
63
"--do_not_mask_with_textline_contour",
70
64
"-nmtc/-mtc",
@@ -76,11 +70,6 @@
76
70
"-bs",
77
71
help="number of inference batch size. Default b_s for trocr and cnn_rnn models are 2 and 8 respectively",
78
72
)
79
-
@click.option(
80
-
"--dataset_abbrevation",
81
-
"-ds_pref",
82
-
help="in the case of extracting textline and text from a xml GT file user can add an abbrevation of dataset name to generated dataset",
83
-
)
84
73
@click.option(
85
74
"--min_conf_value_of_textline_text",
86
75
"-min_conf",
@@ -97,7 +86,6 @@ def ocr_cli(
97
86
dir_out_image_text,
98
87
overwrite,
99
88
tr_ocr,
100
-
export_textline_images_and_text,
101
89
do_not_mask_with_textline_contour,
102
90
batch_size,
103
91
dataset_abbrevation,
@@ -106,18 +94,11 @@ def ocr_cli(
106
94
"""
107
95
Recognize text with a CNN/RNN or transformer ML model.
108
96
"""
109
-
assertnotexport_textline_images_and_textornottr_ocr, "Exporting textline and text -etit can not be set alongside transformer ocr -tr_ocr"
110
-
# FIXME: refactor: move export_textline_images_and_text out of eynollah.py
111
-
# assert not export_textline_images_and_text or not model, "Exporting textline and text -etit can not be set alongside model -m"
112
-
assertnotexport_textline_images_and_textornotbatch_size, "Exporting textline and text -etit can not be set alongside batch size -bs"
113
-
assertnotexport_textline_images_and_textornotdir_in_bin, "Exporting textline and text -etit can not be set alongside directory of bin images -dib"
114
-
assertnotexport_textline_images_and_textornotdir_out_image_text, "Exporting textline and text -etit can not be set alongside directory of images with predicted text -doit"
115
-
assertbool(image) !=bool(dir_in), "Either -i (single image) or -di (directory) must be provided, but not both."
97
+
assertbool(image) ^bool(dir_in), "Either -i (single image) or -di (directory) must be provided, but not both."
0 commit comments