Skip to content

Commit

Permalink
更新paddle_recog评分
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhaoZuohong committed Oct 1, 2023
1 parent c3dcd78 commit 606dcd0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions arknights_mower/utils/character_recognize.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,15 @@ def paddle_recog(__img):
# “森蚺”可能识别成“森”,“孑”可能识别成“子”(子月)
# 以单字猜测双字干员不可靠
# 以“白面鹃”或“白面”匹配“白面鸮”没问题
# 注意避免“白面”匹配到“白雪”
for x in agent_sorted:
score = -abs(len(x) - len(recog_text))
for c in set(x):
score += 1 if c in recog_text else 0
score += 3 if c in recog_text else 0
if score > best_score:
best = x
best_score = score
if best_score > 0:
if best_score > len(best):
logger.debug(f"{recog_text} --?--> {best}")
return best
return None
Expand Down

0 comments on commit 606dcd0

Please sign in to comment.