chore: remove OCR archive, delete collect_ocr_failures, update docs

This commit is contained in:
Your Name committed 2026-01-03 03:50:45 +08:00
1 parent f2cd77ab0b
commit 9e08ed3bd0
18 files changed
+1516 -512

No files matched your search

+18 -6
View File
@@ -127,7 +127,7 @@ class HelperFunctions:
name_res = preprocess_for_ocr(analyser, "开奖结果按钮")
ocr_text = str(analyser.operation.analyse_pic_word(name_res, 0) or "")
analyser._log_kv("开奖结果", "OCR识别结果", text=ocr_text) # type: ignore[attr-defined, reportPrivateUsage]
analyser._log_kv("开奖结果", "OCR识别结果", text=ocr_text, log_type="SCREENSHOT") # type: ignore[attr-defined, reportPrivateUsage]
# 检查识别到的文本
if "我知道了" in ocr_text:
@@ -140,14 +140,20 @@ class HelperFunctions:
# 检查是否为误识别(检查相似字记录)
if HelperFunctions._is_false_positive_prize_text(ocr_text):
analyser._log_kv( # type: ignore[attr-defined, reportPrivateUsage]
"开奖结果", "识别到相似字,判定为误识别", text=ocr_text
"开奖结果",
"识别到相似字,判定为误识别",
text=ocr_text,
log_type="SCREENSHOT",
)
return None
# 如果文本不完全匹配"立即领取奖品",记录相似字用于后续检查
if ocr_text.strip() != "立即领取奖品":
HelperFunctions._save_false_positive(ocr_text)
analyser._log_kv( # type: ignore[attr-defined, reportPrivateUsage]
"开奖结果", "记录相似字文本", text=ocr_text
"开奖结果",
"记录相似字文本",
text=ocr_text,
log_type="SCREENSHOT",
)
return "立即领取奖品"
else:
@@ -165,20 +171,26 @@ class HelperFunctions:
# 检查是否为误识别(检查相似字记录)
if HelperFunctions._is_false_positive_prize_text(ocr_text_1):
analyser._log_kv( # type: ignore[attr-defined, reportPrivateUsage]
"开奖结果", "识别到相似字,判定为误识别", text=ocr_text_1
"开奖结果",
"识别到相似字,判定为误识别",
text=ocr_text_1,
log_type="SCREENSHOT",
)
return None
# 如果文本不完全匹配"立即领取奖品",记录相似字用于后续检查
if ocr_text_1.strip() != "立即领取奖品":
HelperFunctions._save_false_positive(ocr_text_1)
analyser._log_kv( # type: ignore[attr-defined, reportPrivateUsage]
"开奖结果", "记录相似字文本", text=ocr_text_1
"开奖结果",
"记录相似字文本",
text=ocr_text_1,
log_type="SCREENSHOT",
)
return "立即领取奖品"
return None
except Exception as e:
analyser._log_kv("开奖结果", "OCR识别异常", error=str(e)) # type: ignore[attr-defined, reportPrivateUsage]
analyser._log_kv("开奖结果", "OCR识别异常", error=str(e), log_type="ERR") # type: ignore[attr-defined, reportPrivateUsage]
return None
@staticmethod # type: ignore[misc]