Skip to content

Commit

Permalink
Fix detection batching.
Browse files Browse the repository at this point in the history
  • Loading branch information
faustomorales committed Apr 19, 2020
1 parent f6ff3c3 commit 95f6209
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions keras_ocr/detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -675,12 +675,9 @@ def detect(self,
size_threshold: The minimum area for a word.
"""
images = [compute_input(tools.read(image)) for image in images]
boxes = []
for image in images:
boxes.append(
getBoxes(self.model.predict(image[np.newaxis], **kwargs),
boxes = getBoxes(self.model.predict(np.array(images), **kwargs),
detection_threshold=detection_threshold,
text_threshold=text_threshold,
link_threshold=link_threshold,
size_threshold=size_threshold)[0])
size_threshold=size_threshold)
return boxes

0 comments on commit 95f6209

Please sign in to comment.