File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010
1111import json
1212import time
13- import unicodedata
1413from pathlib import Path
1514from typing import TYPE_CHECKING
1615
@@ -49,15 +48,12 @@ def _get_char_id(oper_name: str) -> str:
4948
5049
5150def _normalize_name (name : str ) -> str :
52- """归一化干员名用于匹配(OCR 结果可能与原名有字形差异) 。
51+ """干员名匹配前的最小清理 。
5352
54- - NFKC:上标 ²→2、Ⅲ→III、全角字母数字→半角。
55- - 去除空白 。
53+ PP-OCRv6 rec 模型足够强,不再做 NFKC/字形替换/大小写折叠,避免把
54+ 特殊干员名(如 GALLUS²)改写成与资源名不一致的形式 。
5655 """
57- if not name :
58- return ""
59- name = unicodedata .normalize ("NFKC" , name )
60- return name .replace (" " , "" ).replace (" " , "" )
56+ return name .strip () if name else ""
6157
6258
6359def detect_slots (
@@ -208,6 +204,7 @@ def _ocr_oper_name(context: Context, detail_img: np.ndarray) -> str | None:
208204 "recognition" : "OCR" ,
209205 "roi" : _NAME_ROI ,
210206 "threshold" : 0.3 ,
207+ "order_by" : "Area" ,
211208 }
212209 },
213210 )
You can’t perform that action at this time.
0 commit comments