From d37a6ce9c414166a5903c3615b4a27191ff6eff1 Mon Sep 17 00:00:00 2001 From: Zhao Zuohong Date: Mon, 2 Oct 2023 10:47:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9Bpaddle=5Frecog=E8=AF=84?= =?UTF-8?q?=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- arknights_mower/data/ocr.json | 3 ++- arknights_mower/utils/character_recognize.py | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/arknights_mower/data/ocr.json b/arknights_mower/data/ocr.json index 45b14be23..155404b05 100644 --- a/arknights_mower/data/ocr.json +++ b/arknights_mower/data/ocr.json @@ -39,5 +39,6 @@ "刻力": "刻刀", "泰拉大陆调查": "泰拉大陆调查团", "子": "孑", - "森": "森蚺" + "森": "森蚺", + "屯艾雅法拉": "纯烬艾雅法拉" } diff --git a/arknights_mower/utils/character_recognize.py b/arknights_mower/utils/character_recognize.py index 569b0810a..711030c97 100644 --- a/arknights_mower/utils/character_recognize.py +++ b/arknights_mower/utils/character_recognize.py @@ -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