调整调试图像开关语义

This commit is contained in:
Your Name committed 2026-06-03 01:48:02 +08:00
1 parent 098083a354
commit 168ab4e1f8
9 files changed
+41 -5

No files matched your search

+1 -1
View File
@@ -216,7 +216,7 @@
"monitor_critical_mb": 200.0
},
"debug_captures": {
"enabled": false,
"enabled": true,
"keep_days": 1,
"max_files": 1000,
"auto_cleanup": true,
+1 -1
View File
@@ -128,7 +128,7 @@ class HelperFunctions:
getattr(analyser, "fudai_detail_ui_mode", "auto")
)
x1, y1, x2, y2 = tuple(profile.get("button") or (181, 1261, 890, 1389))
# 裁剪区域用于OCR识别(通过cut_pic会自动保存到debug_captures)
# 裁剪区域仅用于 OCR 输入;调试图由全局 debug_captures 或专用综合标注控制。
douyin_screenshot_handler.ScreenshotHandler.cut_pic(
analyser, x1, y1, x2, y2, "", "开奖结果按钮", 0
)
+6
View File
@@ -148,6 +148,9 @@ def load_config_to_ui(
vars_["fudai_detail_ui_mode_var"].set(
str(cfg.get("fudai_detail_ui_mode", "auto") or "auto")
)
vars_["fudai_detail_save_debug_images_var"].set(
bool(cfg.get("fudai_detail_save_debug_images", False))
)
for key, default in {
"fudai_detail_ocr_content_enabled": True,
"fudai_detail_ocr_value_enabled": True,
@@ -437,6 +440,9 @@ def save_ui_to_config(
)
ui_mode = str(vars_["fudai_detail_ui_mode_var"].get() or "auto").strip().lower()
cfg2["fudai_detail_ui_mode"] = ui_mode if ui_mode in ("auto", "legacy", "v2_0") else "auto"
cfg2["fudai_detail_save_debug_images"] = bool(
vars_["fudai_detail_save_debug_images_var"].get()
)
for key in (
"fudai_detail_ocr_content_enabled",
"fudai_detail_ocr_value_enabled",
+4
View File
@@ -130,6 +130,9 @@ def build_config_vars(cfg: dict) -> Dict[str, tk.Variable]:
fudai_detail_ui_mode_var = tk.StringVar(
value=str(cfg.get("fudai_detail_ui_mode", "auto") or "auto")
)
fudai_detail_save_debug_images_var = tk.BooleanVar(
value=bool(cfg.get("fudai_detail_save_debug_images", False))
)
fudai_detail_ocr_content_enabled_var = tk.BooleanVar(
value=bool(cfg.get("fudai_detail_ocr_content_enabled", True))
)
@@ -493,6 +496,7 @@ def build_config_vars(cfg: dict) -> Dict[str, tk.Variable]:
"fudai_disable_content_recognition_var": fudai_disable_content_recognition_var,
"fudai_disable_task_recognition_var": fudai_disable_task_recognition_var,
"fudai_detail_ui_mode_var": fudai_detail_ui_mode_var,
"fudai_detail_save_debug_images_var": fudai_detail_save_debug_images_var,
"fudai_detail_ocr_content_enabled_var": fudai_detail_ocr_content_enabled_var,
"fudai_detail_ocr_value_enabled_var": fudai_detail_ocr_value_enabled_var,
"fudai_detail_ocr_countdown_enabled_var": fudai_detail_ocr_countdown_enabled_var,
+13 -1
View File
@@ -58,7 +58,7 @@ def setup_debug_tab(parent: ttk.Notebook, *, vars_: Dict[str, tk.Variable]) -> t
debug_r0.pack(fill=X, padx=10, pady=(10, 8))
ttk.Checkbutton(
debug_r0,
text="保存调试图像(OCR / 像素 / 模板等)",
text="全局调试图像(OCR / 像素 / 模板等)",
variable=vars_["debug_captures_enabled_var"],
).pack(side=LEFT)
ttk.Checkbutton(
@@ -237,6 +237,18 @@ def setup_debug_tab(parent: ttk.Notebook, *, vars_: Dict[str, tk.Variable]) -> t
side=LEFT, padx=(6, 0)
)
row4debug = ttk.Frame(fudai_find_box)
row4debug.pack(fill=X, padx=10, pady=(0, 8))
ttk.Checkbutton(
row4debug,
text="保存福袋详情综合标注图(仅一张,不保存逐字段裁剪图)",
variable=vars_["fudai_detail_save_debug_images_var"],
).pack(side=LEFT)
ttk.Label(
row4debug,
text="(不受全局调试图像开关影响,用于核对2.0坐标)",
).pack(side=LEFT, padx=(6, 0))
row4ocr1 = ttk.Frame(fudai_find_box)
row4ocr1.pack(fill=X, padx=10, pady=(0, 8))
for label, var_name in (
+1
View File
@@ -380,6 +380,7 @@ def handle_post(handler, u, runner, csrf_token: str) -> None:
"fudai_quiet_hours_enabled",
"high_value_fudai_enabled",
"fudai_disable_content_recognition",
"fudai_detail_save_debug_images",
"fudai_detail_ocr_content_enabled",
"fudai_detail_ocr_value_enabled",
"fudai_detail_ocr_countdown_enabled",
+4
View File
@@ -29,6 +29,7 @@
"fudai_detail_ocr_task_count_enabled",
"fudai_detail_ocr_task_enabled",
"fudai_detail_ocr_value_enabled",
"fudai_detail_save_debug_images",
"fudai_detail_template_threshold",
"fudai_detail_ui_mode",
"fudai_disable_content_recognition",
@@ -185,6 +186,7 @@
"fudai_detail_ocr_task_count_enabled",
"fudai_detail_ocr_task_enabled",
"fudai_detail_ocr_value_enabled",
"fudai_detail_save_debug_images",
"fudai_detail_template_threshold",
"fudai_detail_ui_mode",
"fudai_disable_content_recognition",
@@ -334,6 +336,7 @@
"fudai_detail_ocr_task_count_enabled",
"fudai_detail_ocr_task_enabled",
"fudai_detail_ocr_value_enabled",
"fudai_detail_save_debug_images",
"fudai_detail_template_threshold",
"fudai_detail_ui_mode",
"fudai_disable_content_recognition",
@@ -485,6 +488,7 @@
"fudai_detail_ocr_task_count_enabled",
"fudai_detail_ocr_task_enabled",
"fudai_detail_ocr_value_enabled",
"fudai_detail_save_debug_images",
"fudai_detail_template_threshold",
"fudai_detail_ui_mode",
"fudai_disable_content_recognition",
+10 -2
View File
@@ -26,12 +26,12 @@
<div class="sectionTitle">调试图像</div>
<div class="row">
<label class="label">保存调试图像(OCR / 像素 / 模板等)</label>
<label class="label">全局调试图像(OCR / 像素 / 模板等)</label>
<label class="check">
<input id="debug_captures_enabled" type="checkbox" data-key="debug_captures.enabled" data-type="bool" />
<span>启用</span>
</label>
<div class="hint">关闭后不再保存调试截图,可显著减少磁盘占用和略微提升速度</div>
<div class="hint">控制阶段检测、像素检测、普通 OCR/模板等全局调试截图;福袋详情综合标注图使用下方独立开关</div>
</div>
<div class="sectionTitle">调试图像清理</div>
@@ -80,6 +80,14 @@
</select>
<div class="hint">auto 默认优先使用当前 2.0 坐标,必要时保留旧版回退</div>
</div>
<div class="row">
<label class="label">福袋详情综合标注图</label>
<label class="check">
<input id="fudai_detail_save_debug_images" type="checkbox" data-key="fudai_detail_save_debug_images" data-type="bool" />
<span>启用</span>
</label>
<div class="hint">只保存一张完整详情页区域标注图,不再保存逐字段裁剪图;不受全局调试图像开关影响</div>
</div>
<div class="row grid3">
<label class="check"><input id="fudai_detail_ocr_content_enabled" type="checkbox" data-key="fudai_detail_ocr_content_enabled" data-type="bool" /> <span>内容 OCR</span></label>
<label class="check"><input id="fudai_detail_ocr_value_enabled" type="checkbox" data-key="fudai_detail_ocr_value_enabled" data-type="bool" /> <span>价值 OCR</span></label>
+1
View File
@@ -133,6 +133,7 @@ const DEFAULTS = {
// 是否禁用福袋内容OCR识别(仅前端默认,实际值以 config.json 为准)
fudai_disable_content_recognition: false,
fudai_detail_ui_mode: "auto",
fudai_detail_save_debug_images: false,
fudai_detail_ocr_content_enabled: true,
fudai_detail_ocr_value_enabled: true,
fudai_detail_ocr_countdown_enabled: true,