Skip to content

Commit

Permalink
fix Could not parse bool from flag (#2359)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shreeshrii authored and zdenop committed Mar 29, 2019
1 parent 521707e commit ea36e94
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/training/tesstrain_utils.py
Expand Up @@ -174,7 +174,7 @@ def check_file_readable(*filenames):
)

parser.add_argument(
"--distort_image", dest="distort_image", help="set --distort_image=true."
"--distort_image", dest="distort_image", action="store_true"
)

tessdata_group = parser.add_argument_group(
Expand Down Expand Up @@ -315,9 +315,11 @@ def generate_font_image(ctx, font, exposure, char_spacing):
f"--exposure={exposure}",
f"--outputbase={outbase}",
f"--max_pages={ctx.max_pages}",
f"--distort_image={ctx.distort_image}",
]

if ctx.distort_image:
common_args.append("--distort_image")

# add --writing_mode=vertical-upright to common_args if the font is
# specified to be rendered vertically.
if font in VERTICAL_FONTS:
Expand Down

0 comments on commit ea36e94

Please sign in to comment.