Skip to content

Commit

Permalink
改进paddle_recog评分
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhaoZuohong committed Oct 2, 2023
1 parent 606dcd0 commit d37a6ce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion arknights_mower/data/ocr.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,6 @@
"刻力": "刻刀",
"泰拉大陆调查": "泰拉大陆调查团",
"子": "",
"森": "森蚺"
"森": "森蚺",
"屯艾雅法拉": "纯烬艾雅法拉"
}
5 changes: 3 additions & 2 deletions arknights_mower/utils/character_recognize.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,15 @@ def paddle_recog(__img):
# 以单字猜测双字干员不可靠
# 以“白面鹃”或“白面”匹配“白面鸮”没问题
# 注意避免“白面”匹配到“白雪”
# “屯艾雅法拉”应匹配“纯烬艾雅法拉”,而非“艾雅法拉”
for x in agent_sorted:
score = -abs(len(x) - len(recog_text))
for c in set(x):
score += 3 if c in recog_text else 0
if score > best_score:
if score >= best_score:
best = x
best_score = score
if best_score > len(best):
if best_score >= len(best):
logger.debug(f"{recog_text} --?--> {best}")
return best
return None
Expand Down

0 comments on commit d37a6ce

Please sign in to comment.