Skip to content

Commit

Permalink
bugfix tesseract detection recognition (#6)
Browse files Browse the repository at this point in the history
Co-authored-by: Nikita Shevtsov <[email protected]>
  • Loading branch information
Travvy88 and Nikita Shevtsov authored Aug 17, 2023
1 parent 4d954e1 commit 216c68d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Changelog
=========
v0.2.2 (2023-08-17)
-------------------
* Bugfix in `TesseractDetectorRecognizer`

v0.2.1 (2023-08-16)
-------------------
* `recognize_bbox` and `recognize_bboxes` methods are added in `AbstractTextRecognizer`
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.1
0.2.2
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ def detect_recognize(self, image: np.ndarray, parameters: Optional[dict] = None)
assert len(words) == len(left) == len(top) == len(width) == len(height), "Number of words and their coordinates should be equal"

text_with_bbox_list = []
for w, x, y, w, h, level in zip(words, left, top, width, height, levels):
for word, x, y, w, h, level in zip(words, left, top, width, height, levels):
if level == 5:
twb = TextWithBBox(text=w, bbox=BBox(x_top_left=x, y_top_left=y, width=w, height=h))
twb = TextWithBBox(text=word, bbox=BBox(x_top_left=x, y_top_left=y, width=w, height=h))
text_with_bbox_list.append(twb)

return text_with_bbox_list

0 comments on commit 216c68d

Please sign in to comment.