Add shopping red packet detection tests and sample image

- Implemented a test script for shopping red packet detection using pixel analysis and OCR.
- Created a sample image to simulate a shopping red packet for testing purposes.
- Added functions to test pixel detection, coordinate definitions, and OCR keyword matching.
- Included detailed print statements for test results and summaries.
This commit is contained in:
Your Name committed 2026-01-08 20:37:49 +08:00
1 parent b3011dd9ce
commit fb0c07c91a
30 files changed
+1269 -319

No files matched your search

+16 -1
View File
@@ -104,6 +104,11 @@ class RunParams:
# Web端新增参数
high_value_room_revisit_enabled: bool
high_value_room_revisit_only_current_run: bool
high_value_room_revisit_min_interval_seconds: int
high_value_room_revisit_max_per_run: int
high_value_room_revisit_min_prize_value: float
high_value_room_revisit_max_age_days: int
high_value_fudai_poll_before_seconds: float
reservation_back_verify_enabled: bool
reservation_back_swipe_delay: float
fudai_find_max_attempts: int
@@ -156,7 +161,9 @@ class Runner:
self._fudai_attend_fail_room_pos: set[int] = set()
# 已记录福袋识别的跟踪(避免同一个直播间同一个福袋重复记录识别次数)
self._recorded_fudai_seen: set[tuple[str, str]] = set() # (room_title, fudai_content)
self._recorded_fudai_seen: set[tuple[str, str]] = (
set()
) # (room_title, fudai_content)
def is_running(self) -> bool:
return self._proc is not None and self._proc.poll() is None
@@ -977,6 +984,14 @@ class Runner:
cmd.append("--high-value-room-revisit-disabled")
if params.high_value_room_revisit_only_current_run:
cmd.append("--high-value-room-revisit-only-current-run")
if params.high_value_room_revisit_min_interval_seconds != 300:
cmd += ["--high-value-room-revisit-min-interval-seconds", str(params.high_value_room_revisit_min_interval_seconds)]
if params.high_value_room_revisit_max_per_run != 5:
cmd += ["--high-value-room-revisit-max-per-run", str(params.high_value_room_revisit_max_per_run)]
if params.high_value_room_revisit_min_prize_value > 0:
cmd += ["--high-value-room-revisit-min-prize-value", str(params.high_value_room_revisit_min_prize_value)]
if params.high_value_room_revisit_max_age_days != 30:
cmd += ["--high-value-room-revisit-max-age-days", str(params.high_value_room_revisit_max_age_days)]
# 预约回退校验
if params.reservation_back_verify_enabled: