74 Commits
Author SHA1 Message Date
Cmake 53116b7e2d feat(mcp): 内嵌 MCP 端点 /api/v1/mcp(11 个工具)
Build and Push / build (push) Successful in 5m58s
- 手写 JSON-RPC 2.0 over HTTP(不引 mcp-go:它要求 go 1.23,本仓库与基础镜像是 1.22)
- initialize / tools/list / tools/call / ping,工具全为只读识别调用,无 dry_run 需求
- 11 工具:list_capabilities / ocr / math / slider_match / slider_comparison / similarity /
  rotate_single / rotate_double / detect_objects(detail 可开逐框细分类)/ classify_object / animal_jump
- 鉴权:MCP_TOKEN(Bearer / X-MCP-Token / ?token=),常量时间比较;token 为空不挂载(fail-closed)
- animal_jump 的 MCP 响应剔除 per_frame,省 agent 上下文
2026-12-04 03:16:01 +08:00
Cmake fd6ac9d4a4 polish(anim): 结果按「先答案后过程」排序,per_frame 默认不返回(include_frames 开启);试用页画布画候选点与轨迹
Build and Push / build (push) Successful in 9m11s
2026-12-04 02:23:06 +08:00
Cmake bd55653222 fix(gif): Disposal 在 gif.GIF.Disposal 平行数组上,不在帧对象里(编译错误)
Build and Push / build (push) Successful in 8m3s
2026-12-04 02:08:06 +08:00
Cmake 4c1e13cfb1 fix(gif): 按 GIF 规范逐帧合成画布(处理 disposal + 子图边界),之前把变化区域当整图导致坐标全错位
Build and Push / build (push) Failing after 5m16s
2026-12-04 02:00:45 +08:00
Cmake 166bc34549 fix(track): 动图轨迹改用 IoU+位移双阈值并容忍漏 2 帧,纯 IoU 会把一跳一跳的轨迹切碎
Build and Push / build (push) Successful in 8m18s
2026-12-04 01:47:13 +08:00
Cmake 8e1d57df2a feat(anim): 多帧(动图)验证码流水线 + 统一任务入口
Build and Push / build (push) Successful in 6m38s
- captcha/pipeline.go:decode_frames(GIF/APNG)→ detect_frames(复用 YOLOX)→ track(IoU 贪心)→ mark_visited
- AnimalJump:动物跳点类验证码,输入动图 + 候选点,返回每个点是否被经过 + 该点的首个帧号 + 未经过点列表
- POST /api/task/run(type 分发,taskTypes 注册表作为新类型扩展点)
- POST /api/frames/detect(逐帧检测,给自定义时序流水线复用)
- GET /api/task/types
- 类型展示 +2 条(动图点选 / 逐帧检测)
- 试用页支持动图任务:动图上传 + 候选点文本 + radius/class_filter
2026-12-04 01:38:31 +08:00
Cmake 85b2844f73 fix(route): 补注册 /api/detection/object/detail(之前只有 handler 没有路由,请求落到 NoRoute 返回首页 HTML)
Build and Push / build (push) Successful in 6m4s
2026-12-04 00:08:08 +08:00
Cmake 68e8b63f75 fix(yolox): 预处理按 YOLOX demo 复刻(左上对齐 pad 114、0~255、不归一化),之前沿用 YOLO11 的居中 letterbox+/255 导致检不到
Build and Push / build (push) Successful in 6m26s
2026-12-03 23:59:34 +08:00
Cmake 66b11944fe feat: 换掉 AGPL 模型,改用 YOLOX-s(Apache-2.0) + MobileNetV3(BSD-3),并加两段式识别
Build and Push / build (push) Successful in 5m46s
- 检测:YOLOX-s 8.96M 参数 [1,3,640,640] → [1,8400,85],网格偏移 + exp(w/h) 解码,类内 NMS
- 分类:MobileNetV3-Large 5.47M 参数,torchvision 预处理(短边232→裁224→ImageNet 归一化)+ softmax
- 新增 /api/detection/object/detail:检测框逐个裁出再分类,给出 fine_class(最多 12 个框)
- 类型展示同步更新模型信息(架构/参数量/预处理说明)
- 导出脚本 trainer/export_apache_models.py(容器内一键导出,含兜底自写 exporter)
2026-12-03 23:50:40 +08:00
Cmake f38b94cf6c fix(classify): 该 yolo11n-cls 按 RGB+/255+直接 resize 训练,归一化会让结果整体跑偏(banana 0.985 / espresso 0.92 实测)
Build and Push / build (push) Successful in 7m6s
2026-12-03 22:15:19 +08:00
Cmake ca00018b83 fix(classify): 输出已是 softmax 概率别再 softmax;预处理对齐 classify_transforms(短边缩放+中心裁+ImageNet 归一化)
Build and Push / build (push) Successful in 6m36s
2026-12-03 22:06:36 +08:00
Cmake 49dce60465 fix(classify): 用 ultralytics ClassifyPredictor 的 mean=0/std=1,之前套 ImageNet 归一化导致概率接近均匀
Build and Push / build (push) Successful in 6m30s
2026-12-03 21:57:15 +08:00
Cmake 89145c9064 feat: 新增目标类型检测与物品分类
Build and Push / build (push) Successful in 6m17s
- /api/detection/object:YOLO11n COCO 80 类,返回 class/confidence/box,按类内 NMS
- /api/classify/object:YOLO11n-cls ImageNet 1000 类,softmax 取 top-5
- 两个模型不入镜像(models/ 挂载卷),启动时存在即加载,缺失只影响对应接口
- 类型展示目录补两条能力 + 两个模型(2.62M / 2.81M 参数)
- 试用页补字段映射
2026-12-03 21:46:04 +08:00
Cmake 91383bebfb feat(api): 补 /api/user/info(控制台显示用户名/角色/余额,之前 404 导致首页停在「加载中」)
Build and Push / build (push) Successful in 7m19s
2026-12-03 21:25:42 +08:00
Cmake 47a03b17b8 polish: 试用页改常驻文件输入(便于自动化/拖拽)、训练页去重文案与表头
Build and Push / build (push) Successful in 6m24s
2026-12-03 20:35:58 +08:00
Cmake cbe037b799 fix(model): TrainTask.PID 显式指定列名 pid(gorm 默认拆成 p_id 导致状态回写报 no such column)
Build and Push / build (push) Successful in 6m12s
2026-12-03 20:22:18 +08:00
Cmake 13498be9b4 fix(train): data.yaml 用相对路径修复 ultralytics 路径拼接;任务状态回写加重试+自愈
Build and Push / build (push) Successful in 5m36s
- ultralytics 会把 train 拼在 path 之后,绝对路径会拼成 datasets/1/data/datasets/1/images
- sqlite 并发写偶发 locked 会让 finish() 静默失败 → 任务永远 running;改为重试 8 次并打日志
- 列表接口顺带自愈:DB 里 running 但内存无进程的任务自动标 failed
2026-12-03 20:01:21 +08:00
Cmake 54d06650c5 feat: 类型展示 + 在线试用 + 在线训练
Build and Push / build (push) Successful in 6m10s
- /api/capabilities:11 项能力 + 6 个模型的结构/参数量/I-O 元数据
- 训练编排:Dataset/TrainTask 表、数据集 zip 上传(含数据校验与 data.yaml 生成)、
  任务创建/启动/取消/日志、进度轮询(status.json + 日志正则双通道)
- 侧边栏控制台(暗色工业风,可折叠):能力与模型页、在线试用页(自动把检测框/缺口画到图上)、在线训练页
- Dockerfile 增加训练层(python + CPU torch + ultralytics,可用 ARG 关掉)
2026-12-03 19:31:08 +08:00
Cmake 2d7a2b33a6 feat(api): 新增 /api/capabilities 类型展示接口(11 类能力 + 6 个模型的参数量/结构/I-O)
Build and Push / build (push) Successful in 5m26s
2026-12-03 19:26:21 +08:00
Hermes 2225f04866 feat(rotate): 双图旋转改为上游的环带模板匹配算法
Build and Push / build (push) Successful in 5m59s
原来那版是「RotNet(内圈) − RotNet(外圈) 取模」,纯粹自己凑的,与上游毫无对应关系,
所以结果 344 无法解释也无法校验。

按上游 solve_double_rotate 逐行移植(pkg/opencv/opencv.cpp 新增 cv_double_rotate):
  1) 内圈:rot90 四次数「整行只有纯黑/纯白」的行数 → 上下左右剪边 → 按短边取偶数直径 resize
  2) 外圈:从中心沿四条射线找第一个非纯黑非纯白像素 → 外扩 resize_check_pixel → 剪边 resize
  3) 两边各做圆环 mask(半径 R / 内半径 R-check_pixel)得到环带
  4) 内圈环带按候选角 getRotationMatrix2D+warpAffine 旋转,与外圈环带 matchTemplate
     (TM_CCOEFF_NORMED) 取最大相似度;粗搜 1..360 step 10,命中更好就追加 angle±10 细化窗口,
     最多保留 5 个候选(与上游边遍历边追加的行为一致)
  5) inner_angle = raw_angle * speed_ratio/(speed_ratio+1)

返回结构也对齐上游:{angle(兼容), inner_angle, raw_angle, similarity};
剪不出有效环带时返回 -2,HTTP 层映射成 400。
2026-12-03 18:14:42 +08:00
Hermes 5a5850e9be fix: 旋转预处理对齐上游 BILINEAR、点选顺序换成真匈牙利算法
Build and Push / build (push) Successful in 4m24s
对照上游 Python + onnxruntime 做了 A/B(模型直接用仓库里那几份 onnx),结论:

1) 旋转:同一张官方例图,上游预处理预测 229,我们预测 319,差 90°。
   逐项排除后锁定在 resize 滤波器:上游 solve_single_rotate 用 PIL 的 BILINEAR,
   我们用了 imaging.Lanczos;把 Go 的裁剪 + BILINEAR 复现出来正好是 229。
   → preprocessRotation 改 imaging.Linear。这是 360 类分类器,缩放核足以改变 argmax。

2) 点选顺序:我们的 "hungarian" 其实是逐行贪心,不是匈牙利算法。
   同一组检测框实测:
     贪心    0.7289 + 0.6894 + 0.7238 = 2.1421(顺序错:提示第1个对到目标第2个)
     全局最优 0.6721 + 0.8752 + 0.7238 = 2.2711(与上游 linear_sum_assignment 一致)
   → 新增 hungarianAssign(增广路 O(n^3),行数>列数时补方阵),
     未匹配位置按上游填 [0,0,0,0] 而不是 null。

3) 顺带清掉 Math 里每次请求都打印的 DEBUG 输出(output 前 10 个值 / 位置0 argmax)。

A/B 还确认了两件「不是 bug」的事:
· OCR 官方例图我们出 'jepv',上游 Python 也是 'jepv' → 大小写是模型行为,不是移植问题
· Math 官方例图上游读出 '8×1=?' 计算 8,我们返回 8 → 一致
2026-12-03 17:36:41 +08:00
Hermes 68f181e0ac fix: 相似度改走双输出 Siamese(对齐上游 AntiCAP),阴影滑块补尺寸校验
Build and Deploy / build (push) Failing after 3m8s
Build and Deploy / deploy (push) Skipped
对照上游 https://github.com/81NewArk/AntiCAP 逐项核对后修两处:

1) 相似度(internal/captcha/handler.go + pkg/onnx)
   上游是 outputs = session.run(None, feed); emb1, emb2 = outputs[0], outputs[1]
   —— 模型本身分别吐出两路 embedding。
   旧实现只 run 了 1 个输出(onnx.cpp 里 Run 的 output_count = 1),
   再把这个张量从中间切成两半当两个 embedding,
   实测四组完全不同的输入返回同一个值(0.49188173),等于接口失效。
   现在新增 onnx_run_dual_input_two_outputs 取前两个输出,
   两路各算 L2 距离后 1/(1+dist);单输出模型保留旧路径回退并打日志。

2) 阴影滑块(pkg/opencv + internal/handler)
   上游 solve_slider_comparison 要求 target 与 background 同尺寸
   (PIL ImageChops.difference 的硬前提),旧实现不校验,
   尺寸不同时直接抛 OpenCV -209 尺寸不匹配,返回 500。
   现在前置校验并返回 400 + 明确原因;SliderMatch 也补了「滑块不能大于背景」的校验。

预处理与旋转逻辑核对结论:preprocessSiamese(105×105 / ImageNet norm)与
preprocessRotation(正方形中心裁剪 + h/√2 + 224 / ImageNet norm)与上游一致,未改。
2026-12-03 08:23:51 +08:00
admin 47970834ec fix: remove ImageNet normalization for YOLO (match Ultralytics default)
Build and Deploy / build (push) Successful in 2m45s
Build and Deploy / deploy (push) Successful in 10s
- Ultralytics YOLO only does /255 normalization, no ImageNet mean/std
- This was causing detection box coordinate drift
2026-07-18 05:37:54 +00:00
admin e423f2ddd3 docs: add comments to rotation preprocessing
Build and Deploy / build (push) Successful in 2m40s
Build and Deploy / deploy (push) Successful in 9s
2026-07-17 23:14:27 +00:00
admin 234d9a9acb fix: use original parameter names for similarity API
Build and Deploy / build (push) Successful in 2m41s
Build and Deploy / deploy (push) Successful in 9s
- Change img1_base64/img2_base64 to image1_base64/image2_base64
- Match original AntiCAP API parameter names
2026-07-17 21:22:31 +00:00
admin 10a2acaf7b fix: use letterbox preprocessing for YOLO (same as ultralytics)
Build and Deploy / build (push) Successful in 3m12s
Build and Deploy / deploy (push) Successful in 9s
- Keep aspect ratio with gray padding instead of stretching
- Add ImageNet normalization (mean/std)
- Proper coordinate restoration with offset/scale
- This matches original Python ultralytics preprocessing
2026-07-17 21:02:13 +00:00
admin 16e49a6d9e fix: lower threshold for small order images (284x106)
Build and Deploy / build (push) Successful in 2m42s
Build and Deploy / deploy (push) Successful in 9s
2026-07-17 20:52:36 +00:00
admin 1187a35fcf fix: correct YOLO output format [features, boxes] with clear comments
Build and Deploy / build (push) Successful in 2m41s
Build and Deploy / deploy (push) Successful in 8s
2026-07-17 20:25:23 +00:00
admin 3ef9742376 fix: YOLO output format is [boxes, features] not [features, boxes]
Build and Deploy / build (push) Successful in 2m40s
Build and Deploy / deploy (push) Successful in 9s
2026-07-17 20:18:14 +00:00
admin e2ac2fbfcc debug: print YOLO output values and max confidence
Build and Deploy / build (push) Successful in 2m43s
Build and Deploy / deploy (push) Successful in 9s
2026-07-17 14:43:59 +00:00
admin c096e364cd fix: lower confidence threshold for small order images
Build and Deploy / build (push) Successful in 2m42s
Build and Deploy / deploy (push) Successful in 9s
2026-07-17 14:18:48 +00:00
admin 5cb160432a fix: scale YOLO coordinates from 640x640 to original image size, add debug output
Build and Deploy / build (push) Successful in 2m42s
Build and Deploy / deploy (push) Successful in 9s
2026-07-17 13:14:41 +00:00
admin b0555e2281 feat: implement YOLO detection using ONNX Runtime (OpenCV 4.6 incompatible with YOLO11)
Build and Deploy / build (push) Successful in 2m43s
Build and Deploy / deploy (push) Successful in 9s
2026-07-17 12:59:36 +00:00
admin 588f0a846b fix: another UTF-8 string index bug in debug output
Build and Deploy / build (push) Successful in 2m44s
Build and Deploy / deploy (push) Successful in 9s
2026-07-17 12:54:32 +00:00
admin e17549c508 docs: add detailed comment for UTF-8 charset fix
Build and Deploy / build (push) Successful in 2m39s
Build and Deploy / deploy (push) Successful in 1s
2026-07-17 12:45:34 +00:00
admin f7cfc4a888 fix: use string slice for CHARS to handle UTF-8 multibyte chars correctly
Build and Deploy / build (push) Successful in 2m43s
Build and Deploy / deploy (push) Successful in 9s
2026-07-17 12:43:17 +00:00
admin 5a86d68228 debug: print full CHARS mapping and all 51 indices
Build and Deploy / build (push) Successful in 2m41s
Build and Deploy / deploy (push) Successful in 10s
2026-07-17 12:33:49 +00:00
admin 65c77452c2 debug: show raw indices and fix boundary check
Build and Deploy / build (push) Successful in 2m43s
Build and Deploy / deploy (push) Successful in 9s
2026-07-17 12:26:31 +00:00
admin ae4bf8dd36 debug: print argmax results for Math CTC decode
Build and Deploy / build (push) Successful in 2m42s
Build and Deploy / deploy (push) Successful in 9s
2026-07-17 12:19:55 +00:00
admin 0145bf9e44 debug: add logging for Math ONNX output
Build and Deploy / build (push) Successful in 2m41s
Build and Deploy / deploy (push) Successful in 9s
2026-07-17 12:12:48 +00:00
admin a3665ed63a fix: correct Math decode - output is [num_positions, batch, num_chars]
Build and Deploy / build (push) Successful in 3m3s
Build and Deploy / deploy (push) Successful in 11s
2026-07-17 11:53:17 +00:00
admin f2bc0ecdb2 fix: correct Math model output format - [T,B,C] not [C,B,T]
Build and Deploy / build (push) Successful in 2m45s
Build and Deploy / deploy (push) Successful in 9s
2026-07-17 11:48:15 +00:00
admin 6c123b7231 fix: correct Math model output transpose from [C,B,T] to [B,T,C]
Build and Deploy / build (push) Successful in 2m44s
Build and Deploy / deploy (push) Successful in 9s
2026-07-17 11:38:24 +00:00
admin 2fceca847f fix: use separate variable for evalMathExpression result
Build and Deploy / build (push) Successful in 2m43s
Build and Deploy / deploy (push) Successful in 9s
2026-07-17 11:25:29 +00:00
admin 7dae9a0901 fix: avoid GetOutputShape CGO crash by using fixed output dimensions
Build and Deploy / build (push) Failing after 2m24s
Build and Deploy / deploy (push) Has been skipped
2026-07-17 11:02:00 +00:00
admin dc58cc1dba fix: add panic recovery and boundary checks for Math function
Build and Deploy / deploy (push) Has been cancelled
Build and Deploy / build (push) Has been cancelled
2026-07-17 10:59:47 +00:00
admin 89b688424a fix: rename min function to avoid conflict with builtin
Build and Deploy / build (push) Successful in 2m39s
Build and Deploy / deploy (push) Successful in 9s
2026-07-17 10:57:45 +00:00
admin 8c8787135d fix: rewrite Math preprocessing and decode to match original AntiCAP implementation
Build and Deploy / build (push) Successful in 2m42s
Build and Deploy / deploy (push) Successful in 9s
2026-07-17 10:33:04 +00:00
admin 0c2225bdbb fix: handle dynamic dimensions in Math output shape
Build and Deploy / build (push) Successful in 2m42s
Build and Deploy / deploy (push) Successful in 9s
2026-07-17 10:24:41 +00:00
admin 61f3223885 fix: correct Math CRNN output transpose and CTC decoding
Build and Deploy / build (push) Successful in 2m43s
Build and Deploy / deploy (push) Successful in 9s
2026-07-17 10:03:40 +00:00