Skip to content

Commit

Permalink
fix: U-Offical 可能识别错误
Browse files Browse the repository at this point in the history
  • Loading branch information
Shawnsdaddy committed Apr 15, 2023
1 parent 9f3a01d commit c9c7ebc
Show file tree
Hide file tree
Showing 2 changed files with 10 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
14 changes: 9 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 @@ -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
Expand Down

0 comments on commit c9c7ebc

Please sign in to comment.