Skip to content

Commit 287fda7

Browse files
author
Rasmus
committed
avoiding multiple sequential spaces
1 parent 95f6209 commit 287fda7

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

keras_ocr/data_generation.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,11 @@ def convert_image_generator_to_recognizer_input(image_generator,
259259
if not line:
260260
continue
261261
box, sentence = tools.combine_line(line)
262+
263+
# remove multiple sequential spaces
264+
while (" " in sentence):
265+
sentence = sentence.replace(" ", " ")
266+
262267
crop = tools.warpBox(image=image,
263268
box=box,
264269
target_width=target_width,

0 commit comments

Comments
 (0)