Skip to content

Commit ea36e94

Browse files
Shreeshriizdenop
authored andcommitted
fix Could not parse bool from flag (#2359)
1 parent 521707e commit ea36e94

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/training/tesstrain_utils.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def check_file_readable(*filenames):
174174
)
175175

176176
parser.add_argument(
177-
"--distort_image", dest="distort_image", help="set --distort_image=true."
177+
"--distort_image", dest="distort_image", action="store_true"
178178
)
179179

180180
tessdata_group = parser.add_argument_group(
@@ -315,9 +315,11 @@ def generate_font_image(ctx, font, exposure, char_spacing):
315315
f"--exposure={exposure}",
316316
f"--outputbase={outbase}",
317317
f"--max_pages={ctx.max_pages}",
318-
f"--distort_image={ctx.distort_image}",
319318
]
320319

320+
if ctx.distort_image:
321+
common_args.append("--distort_image")
322+
321323
# add --writing_mode=vertical-upright to common_args if the font is
322324
# specified to be rendered vertically.
323325
if font in VERTICAL_FONTS:

0 commit comments

Comments
 (0)