Skip to content

Commit

Permalink
为选人界面PaddleOCR识别结果添加检验
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhaoZuohong committed Sep 30, 2023
1 parent 4965600 commit 9faa8c5
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions arknights_mower/utils/character_recognize.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,11 @@ def agent(img, draw=False):
ret_succ.append(poly)
continue
if len(res := arknights_mower.utils.paddleocr.ocr(__img)[1]) > 0:
logger.debug(f"PaddleOCR识别结果:{res[0]}")
ret_agent.append(res[0][0])
ret_succ.append(poly)
continue
logger.debug(f"PaddleOCR识别结果:{res}")
if op_name := next((r[0] for r in res if r[0] in agent_list), None):
ret_agent.append(op_name)
ret_succ.append(poly)
continue
res = sift_recog(__img, resolution, draw)
if (res is not None) and res in agent_list:
ret_agent.append(res)
Expand All @@ -191,10 +192,11 @@ def agent(img, draw=False):
if 80 <= np.min(__img):
continue
if len(res := arknights_mower.utils.paddleocr.ocr(__img)[1]) > 0:
logger.debug(f"PaddleOCR识别结果:{res[0]}")
ret_agent.append(res[0][0])
ret_succ.append(poly)
continue
logger.debug(f"PaddleOCR识别结果:{res}")
if op_name := next((r[0] for r in res if r[0] in agent_list), None):
ret_agent.append(op_name)
ret_succ.append(poly)
continue
res = sift_recog(__img, resolution, draw)
if res is not None:
ret_agent.append(res)
Expand Down

0 comments on commit 9faa8c5

Please sign in to comment.