From c9c7ebc6e279e8529b947b2e04e11525478a4c72 Mon Sep 17 00:00:00 2001 From: Shawnsdaddy Date: Sat, 15 Apr 2023 01:38:29 -0700 Subject: [PATCH] =?UTF-8?q?fix:=20U-Offical=20=E5=8F=AF=E8=83=BD=E8=AF=86?= =?UTF-8?q?=E5=88=AB=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- arknights_mower/solvers/base_schedule.py | 1 + arknights_mower/utils/character_recognize.py | 14 +++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/arknights_mower/solvers/base_schedule.py b/arknights_mower/solvers/base_schedule.py index 1345155bb..d14bd55f7 100644 --- a/arknights_mower/solvers/base_schedule.py +++ b/arknights_mower/solvers/base_schedule.py @@ -54,6 +54,7 @@ def __init__(self, device: Device = None, recog: Recognizer = None) -> None: self.max_resting_count = 4 self.party_time = None self.drone_time = None + self.run_order_delay=10 def run(self) -> None: """ diff --git a/arknights_mower/utils/character_recognize.py b/arknights_mower/utils/character_recognize.py index af7d48f32..b84d700e9 100644 --- a/arknights_mower/utils/character_recognize.py +++ b/arknights_mower/utils/character_recognize.py @@ -9,7 +9,7 @@ from PIL import Image, ImageDraw, ImageFont from .. import __rootdir__ -from ..data import agent_list +from ..data import agent_list,ocr_error from . import segment from .image import saveimg from .log import logger @@ -172,7 +172,7 @@ def agent(img, draw=False): f'干员名称识别异常:{x[1]} 为不存在的数据,请报告至 https://github.com/Konano/arknights-mower/issues' ) saveimg(__img, 'failure_agent') - raise Exception("启动 Plan B") + raise Exception(x[1]) else: if 80 <= np.min(__img): continue @@ -189,9 +189,13 @@ def agent(img, draw=False): except Exception as e: # 大哥不行了,二哥上! ret_fail.append(poly) - if name in ocr_error.keys(): - name = ocr_error[name] - else: + if "Plan B" not in e: + if e in ocr_error.keys(): + name = ocr_error[e] + elif "Off" in e: + name = 'U-Official' + else: + continue ret_agent.append(name) ret_succ.append(poly) continue