Support external FunCaptcha ONNX fallback
This commit is contained in:
12
CLAUDE.md
12
CLAUDE.md
@@ -484,11 +484,23 @@ uv run python cli.py predict image.png --type normal # 跳过分类直接
|
||||
uv run python cli.py predict image.png --type 3d_rotate # 指定为旋转类型
|
||||
uv run python cli.py predict-dir ./test_images/ # 批量识别
|
||||
uv run python cli.py predict-funcaptcha challenge.jpg --question 4_3d_rollball_animals
|
||||
FUNCAPTCHA_ROLLBALL_MODEL_PATH=/path/to/4_3d_rollball_animals.onnx \
|
||||
uv run python cli.py predict-funcaptcha challenge.jpg --question 4_3d_rollball_animals
|
||||
|
||||
# 启动 HTTP 服务 (需先安装 server 可选依赖)
|
||||
uv run python cli.py serve --port 8080
|
||||
```
|
||||
|
||||
FunCaptcha 专项 ONNX 查找顺序:
|
||||
- `onnx_models/funcaptcha_rollball_animals.onnx`
|
||||
- 环境变量 `FUNCAPTCHA_ROLLBALL_MODEL_PATH`
|
||||
- 默认回退 `/mnt/data/code/python/funcaptcha-server/model/4_3d_rollball_animals.onnx`
|
||||
|
||||
注意:
|
||||
- `models/` 目录用于 Python 源码,不放 ONNX 产物
|
||||
- 本仓库导出的 FunCaptcha ONNX 会携带 sidecar metadata 并使用 centered RGB 预处理
|
||||
- 外部兼容 ONNX 若无 metadata,推理层需回退到 `funcaptcha-server` 的 `/255.0` RGB 预处理契约
|
||||
|
||||
## HTTP 服务 (server.py,可选)
|
||||
|
||||
纯推理服务,不依赖 torch / 训练代码,仅需 onnxruntime + FastAPI。
|
||||
|
||||
Reference in New Issue
Block a user