Skip to content

Commit

Permalink
avoiding multiple sequential spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Rasmus committed May 24, 2020
1 parent 95f6209 commit 287fda7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions keras_ocr/data_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,11 @@ def convert_image_generator_to_recognizer_input(image_generator,
if not line:
continue
box, sentence = tools.combine_line(line)

# remove multiple sequential spaces
while (" " in sentence):
sentence = sentence.replace(" ", " ")

crop = tools.warpBox(image=image,
box=box,
target_width=target_width,
Expand Down

0 comments on commit 287fda7

Please sign in to comment.