From 8d69c2d4a3526faf84aacf06db4dc77e07448b81 Mon Sep 17 00:00:00 2001 From: Zhao Zuohong Date: Fri, 13 Oct 2023 00:34:23 +0800 Subject: [PATCH] =?UTF-8?q?read=5Fscreen=E4=B8=AD=E4=BD=BF=E7=94=A8ocr=5Fe?= =?UTF-8?q?rror=E7=BA=A0=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- arknights_mower/solvers/base_schedule.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arknights_mower/solvers/base_schedule.py b/arknights_mower/solvers/base_schedule.py index 7682243fe..6f8ba41b0 100644 --- a/arknights_mower/solvers/base_schedule.py +++ b/arknights_mower/solvers/base_schedule.py @@ -15,7 +15,7 @@ from .skland import SKLand from ..command import recruit -from ..data import agent_list, base_room_list +from ..data import agent_list, base_room_list, ocr_error from ..utils import character_recognize, detector, segment from ..utils.digit_reader import DigitReader from ..utils.operators import Operators, Operator, Dormitory @@ -944,6 +944,10 @@ def read_screen(self, img, type="mood", limit=24, cord=None): elif 'name' in type: if ret in agent_list: return ret + if ret in ocr_error: + name = ocr_error[ret] + logger.debug(f"{ret} =====> {name}") + return name if name := character_recognize.paddle_guess_agent(ret): return name return character_recognize.agent_name(img, self.recog.h)