Skip to content

Commit

Permalink
add text normalize
Browse files Browse the repository at this point in the history
  • Loading branch information
kotaro-kinoshita committed Nov 28, 2024
1 parent d71ebb9 commit 3747cea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/yomitoku/text_recognizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import numpy as np
import torch
import unicodedata
from pydantic import conlist

from .base import BaseModelCatalog, BaseModule, BaseSchema
Expand Down Expand Up @@ -72,6 +73,8 @@ def preprocess(self, img, polygons):

def postprocess(self, p, points):
pred, score = self.tokenizer.decode(p)
pred = [unicodedata.normalize("NFKC", x) for x in pred]

directions = []
for point in points:
point = np.array(point)
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3747cea

Please sign in to comment.