Skip to content

Commit

Permalink
[sync] doctr vocabs
Browse files Browse the repository at this point in the history
  • Loading branch information
felixdittrich92 committed Aug 23, 2024
1 parent 4818b94 commit 08052bb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion onnxtr/models/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ def _build_blocks(
Line([
Word(
*word_preds[idx],
tuple([tuple(pt) for pt in boxes[idx].tolist()]), # type: ignore[arg-type]
tuple(tuple(pt) for pt in boxes[idx].tolist()), # type: ignore[arg-type]
float(objectness_scores[idx]),
crop_orientations[idx],
)
Expand Down
4 changes: 4 additions & 0 deletions onnxtr/utils/vocabs.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"hindi_punctuation": "।,?!:्ॐ॰॥॰",
"bangla_letters": "অআইঈউঊঋএঐওঔকখগঘঙচছজঝঞটঠডঢণতথদধনপফবভমযরলশষসহ়ঽািীুূৃেৈোৌ্ৎংঃঁ",
"bangla_digits": "০১২৩৪৫৬৭৮৯",
"generic_cyrillic_letters": "абвгдежзийклмнопрстуфхцчшщьюяАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЬЮЯ",
}

VOCABS["latin"] = VOCABS["digits"] + VOCABS["ascii_letters"] + VOCABS["punctuation"]
Expand Down Expand Up @@ -59,6 +60,9 @@
VOCABS["hebrew"] = VOCABS["english"] + "אבגדהוזחטיכלמנסעפצקרשת" + "₪"
VOCABS["hindi"] = VOCABS["hindi_letters"] + VOCABS["hindi_digits"] + VOCABS["hindi_punctuation"]
VOCABS["bangla"] = VOCABS["bangla_letters"] + VOCABS["bangla_digits"]
VOCABS["ukrainian"] = (
VOCABS["generic_cyrillic_letters"] + VOCABS["digits"] + VOCABS["punctuation"] + VOCABS["currency"] + "ґіїєҐІЇЄ₴"
)
VOCABS["multilingual"] = "".join(
dict.fromkeys(
VOCABS["french"]
Expand Down

0 comments on commit 08052bb

Please sign in to comment.