15 Commits
Author SHA1 Message Date
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 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 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 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 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 ad6a130a6f fix: update DoubleRotate to match new signature with all parameters
Build and Deploy / build (push) Successful in 2m43s
Build and Deploy / deploy (push) Has been skipped
2026-07-16 22:54:03 +00:00
admin 349b5985b7 fix: 移除不必要的类型转换 user.ID 已是 uint
Build and Deploy / build (push) Successful in 2m8s
Build and Deploy / deploy (push) Has been skipped
2026-07-16 19:07:36 +00:00
admin a6b03a6152 fix: 安装时创建管理员用户,登录从数据库验证
Build and Deploy / build (push) Failing after 1m49s
Build and Deploy / deploy (push) Has been skipped
2026-07-16 18:50:54 +00:00
admin 524c404194 feat: initial commit - Go + CGO captcha recognition service
Build and Deploy / build-frontend (push) Failing after 2s
Build and Deploy / build-backend (push) Has been skipped
Build and Deploy / build-docker (push) Has been skipped
Build and Deploy / deploy (push) Has been skipped
Features:
- Go + CGO ONNX/OpenCV wrapper for high performance
- SQLite (default) / MySQL database support
- Optional Redis caching
- JWT authentication system
- Multiple captcha recognition APIs:
  - OCR text recognition
  - Slider captcha matching
  - Image similarity comparison
  - Rotation captcha detection
  - Object detection
- React frontend with install wizard
- Docker and docker-compose support
- Gitea CI/CD pipeline

Project structure:
- cmd/server: Main entry point
- internal/: Core business logic
- pkg/onnx: ONNX Runtime CGO wrapper
- pkg/opencv: OpenCV CGO wrapper
- web/: React frontend
- deploy/: Deployment configs
- scripts/: Utility scripts
2026-07-16 08:56:38 +00:00