Skip to content

Commit

Permalink
Merge pull request #10 from Konano/dev_shawn
Browse files Browse the repository at this point in the history
Dev shawn
  • Loading branch information
Ks-luow authored Apr 15, 2023
2 parents 2f3b64e + b960fdb commit 72623b8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
1 change: 1 addition & 0 deletions arknights_mower/solvers/base_schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
"""
Expand Down
15 changes: 10 additions & 5 deletions arknights_mower/utils/character_recognize.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -188,10 +188,15 @@ def agent(img, draw=False):
raise Exception("启动 Plan B")
except Exception as e:
# 大哥不行了,二哥上!
_msg = str(e)
ret_fail.append(poly)
if name in ocr_error.keys():
name = ocr_error[name]
else:
if "Plan B" not in _msg:
if _msg in ocr_error.keys():
name = ocr_error[_msg]
elif "Off" in _msg:
name = 'U-Official'
else:
continue
ret_agent.append(name)
ret_succ.append(poly)
continue
Expand Down

0 comments on commit 72623b8

Please sign in to comment.