Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit b2ce1c7

Browse files
committed
text recognition example upd
1 parent 2dc5266 commit b2ce1c7

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

tests/examples.ipynb

Lines changed: 9 additions & 9 deletions
Large diffs are not rendered by default.

tests/helloworld.png

-9.35 KB
Loading

tests/text_recognition.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def _get_confidences(self, img: np.ndarray, box: tuple) -> np.ndarray:
3737
return outs
3838

3939
def do_ocr(self, img: np.ndarray, bboxes: List[tuple]) -> List[str]:
40-
""" Run OCR pipeline for a single words
40+
""" Run OCR pipeline with greedy decoder for each single word (bbox)
4141
4242
:param img: BGR image
4343
:param bboxes: list of sepaate word bboxes (ymin ,xmin ,ymax, xmax)
@@ -60,7 +60,7 @@ def do_ocr(self, img: np.ndarray, bboxes: List[tuple]) -> List[str]:
6060
for box in bboxes:
6161
# confidence distribution across symbols
6262
confs = self._get_confidences(img, box)
63-
# get maximal confidence for the whole beam width
63+
# get maximal confidence for the whole beam width aka greedy decoder
6464
idxs = confs[:, 0, :].argmax(axis=1)
6565
# drop blank characters '#' with id == 36 in charvec
6666
# isupposedly we taking only separate words as input

0 commit comments

Comments
 (0)