Skip to content

Commit

Permalink
Merge pull request #50 from kotaro-kinoshita/fix/split-voiced-point-code
Browse files Browse the repository at this point in the history
add prediction text normalize
  • Loading branch information
kotaro-kinoshita authored Nov 28, 2024
2 parents d71ebb9 + 3747cea commit b4e6830
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 b4e6830

Please sign in to comment.