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:
1 parent
b3011dd9ce
commit
fb0c07c91a
30 files changed
+1269
-319
No files matched your search
+32
@@ -222,6 +222,30 @@ def parse_args(argv: list[str]) -> argparse.Namespace:
|
||||
action="store_true",
|
||||
help="仅回访本次运行记录的高价值直播间",
|
||||
)
|
||||
p.add_argument(
|
||||
"--high-value-room-revisit-min-interval-seconds",
|
||||
type=int,
|
||||
default=300,
|
||||
help="高价值房间重访最小间隔时间(秒,默认300)",
|
||||
)
|
||||
p.add_argument(
|
||||
"--high-value-room-revisit-max-per-run",
|
||||
type=int,
|
||||
default=5,
|
||||
help="每次运行最大重访次数(默认5)",
|
||||
)
|
||||
p.add_argument(
|
||||
"--high-value-room-revisit-min-prize-value",
|
||||
type=float,
|
||||
default=0.0,
|
||||
help="重访最低奖品价值阈值(元,默认0.0)",
|
||||
)
|
||||
p.add_argument(
|
||||
"--high-value-room-revisit-max-age-days",
|
||||
type=int,
|
||||
default=30,
|
||||
help="重访最大年龄天数(默认30)",
|
||||
)
|
||||
p.add_argument(
|
||||
"--reservation-back-verify-enabled",
|
||||
action="store_true",
|
||||
@@ -515,6 +539,14 @@ def main(argv: list[str]) -> int:
|
||||
analyser.high_value_room_revisit_enabled = False
|
||||
if getattr(args, "high_value_room_revisit_only_current_run", False):
|
||||
analyser.high_value_room_revisit_only_current_run = True
|
||||
if getattr(args, "high_value_room_revisit_min_interval_seconds", None) is not None:
|
||||
analyser.high_value_room_revisit_min_interval_seconds = args.high_value_room_revisit_min_interval_seconds
|
||||
if getattr(args, "high_value_room_revisit_max_per_run", None) is not None:
|
||||
analyser.high_value_room_revisit_max_per_run = args.high_value_room_revisit_max_per_run
|
||||
if getattr(args, "high_value_room_revisit_min_prize_value", None) is not None:
|
||||
analyser.high_value_room_revisit_min_prize_value = args.high_value_room_revisit_min_prize_value
|
||||
if getattr(args, "high_value_room_revisit_max_age_days", None) is not None:
|
||||
analyser.high_value_room_revisit_max_age_days = args.high_value_room_revisit_max_age_days
|
||||
# 预约回退校验开关(命令行优先)
|
||||
if getattr(args, "reservation_back_verify_enabled", False):
|
||||
analyser.reservation_back_verify_enabled = True
|
||||
|
||||
Reference in new issue
Block a user