feat(web): 靶子显示友好名 + 支持连打次数

- targets.py 增加 label 字段(1ms 签到 / mliev 登录),下拉框、说明、历史表统一用友好名
- POST /api/jobs 支持 count(1~20):一次任务连打 N 发,发间自动按靶子频控节流、可取消
- 每发结果记入 stats.rounds,EVT_VERIFY 带 round,结果区展示「每发结果(通过 x/y)」彩色一览
- 滑块不再生成标注图(红圈+序号只表达点击顺序,对滑块是误导)
- 观测台 README 补齐启动/后台运行/端口占用/自检说明
This commit is contained in:
yml2213
2026-10-15 11:20:24 +08:00
parent 99565f65f0
commit 5c4ff8c4a1
8 changed files with 534 additions and 222 deletions
+11 -8
View File
@@ -74,16 +74,19 @@ def annotate_points(bg: Any,
prompt: Any = None,
offsets: Optional[Sequence[Optional[float]]] = None,
centroids: Optional[Sequence[Optional[Sequence[float]]]] = None,
title: str = "") -> bytes:
title: str = "",
embed_prompt: bool = True) -> bytes:
"""在底图上按**点击顺序**画编号红圈,可选贴提示图、标出质心与偏差。
参数:
points 点击点序列(背景图原始像素),**顺序即答案顺序**
prompt 提示图(图标/文字点选题),会缩放到右上角
offsets 每个点离图标笔画质心的距离(px),标在圈上
centroids 每个点的质心坐标,画一个蓝色十字(一眼看出偏没偏)
title 左上角标题(如 "icon_click ec=0")
"""
points 点击点序列(背景图原始像素),**顺序即答案顺序**
prompt 提示图(图标/文字点选题)
offsets 每个点离图标笔画质心的距离(px),标在圈上
centroids 每个点的质心坐标,画一个蓝色十字(一眼看出偏没偏)
title 左上角标题(如 "第 1 题")
embed_prompt 是否把提示图贴进右上角。命令行/落盘单图查看时贴(默认 True);
**Web 界面传 False** —— 那边提示图是独立一张缩略图,
贴进去只会挡住右上角的图标(实测会遮住一个目标)。"""
bgr = to_bgr(bg)
for i, pt in enumerate(points):
x, y = int(pt[0]), int(pt[1])
@@ -98,7 +101,7 @@ def annotate_points(bg: Any,
if offsets and i < len(offsets) and offsets[i] is not None:
cv2.putText(bgr, "%.0fpx" % offsets[i], (x - 20, y + _RING_RADIUS + 16),
cv2.FONT_HERSHEY_SIMPLEX, 0.5, _CENTROID_COLOR, 1)
if prompt is not None:
if prompt is not None and embed_prompt:
try:
pr = to_bgr(prompt)
ph = max(1, bgr.shape[0] // 4)