FlanChanXwO commited on
Commit
cfff3e4
·
verified ·
1 Parent(s): 0b767e2

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +27 -58
README.md CHANGED
@@ -1,6 +1,5 @@
1
  ---
2
  language:
3
- - zh
4
  - en
5
  license: agpl-3.0
6
  tags:
@@ -15,7 +14,7 @@ metrics:
15
  - name: "validation accuracy"
16
  type: accuracy
17
  value: 0.886
18
- - name: "real login success (per-attempt)"
19
  type: accuracy
20
  value: 0.876
21
  - name: "login success with retries"
@@ -25,28 +24,19 @@ metrics:
25
 
26
  # PHPWind Captcha OCR
27
 
28
- **中文**:识别 PHPWind 论坛内置验证码的 OCR 模型(4 位数字)。完全本地推理,无外部 API 依赖,4 MB。
29
- **English**: An OCR model for the built-in PHPWind forum captcha (4 digits). Fully local inference, no external API, 4 MB.
30
 
31
- ---
32
-
33
- ## 识别对象 / What it recognizes
34
-
35
- **中文**:下面这类 PHPWind 论坛登录验证码(彩色数字 + 干扰线):
36
- **English**: The PHPWind forum login captcha (colored digits + noise lines):
37
 
38
  ![example captcha](assets/example_captcha.png)
39
 
40
  ```
41
- 示例输入 (example input) → 模型输出 (model output): 9125
42
  ```
43
 
44
- **中文**:验证码是 PHPWind 内置组件(`PwVerifyCode` / `PwGDCode`),彩色数字、干扰线、扭曲均为其标准特征。
45
- **English**: This is PHPWind's built-in captcha component (`PwVerifyCode`/`PwGDCode`) — colored digits, noise lines and distortion are its standard features.
46
-
47
- ---
48
 
49
- ## 快速使用 / Quick Start
50
 
51
  ### Python (onnxruntime)
52
 
@@ -74,59 +64,38 @@ print(solve("captcha.png")) # e.g. "9125"
74
 
75
  See [docs/INFERENCE.md](docs/INFERENCE.md).
76
 
77
- ---
78
-
79
- ## 输入 / 输出规格 (I/O spec)
80
 
81
- | 中文 | English |
82
  |---|---|
83
- | 输入 `input`:`[batch, 3, 64, 160]` float32 (RGB, [0,1]) | Input `input`: `[batch, 3, 64, 160]` float32 (RGB, [0,1]) |
84
- | 输出 `logits`:`[batch, 4, 10]`,每位置 argmax → 数字 | Output `logits`: `[batch, 4, 10]`, argmax per position → digit |
85
- | ONNX opset 18 | ONNX opset 18 |
86
- | 预处理:RGB → 160x64 (BILINEAR) → /255 | Preprocess: RGB → 160x64 (BILINEAR) → /255 |
87
-
88
- ---
89
 
90
- ## 评估结果 / Evaluation
91
 
92
- **中文**:用真实论坛登录作为 ground truth(登录成功 = 识别正确)。
93
- **English**: Evaluated against real forum logins (login success = correct recognition).
94
 
95
- | 指标 / Metric | 数值 / Value |
96
  |---|---|
97
- | 验证集精度 / Validation accuracy | 88.6% |
98
- | 真实登录单次命中 / Per-attempt login success | **87.6%** (85/97) |
99
- | 带重试登录成功率 / With retries | ≈99.9997% |
100
 
101
- **中文**:详情见 [docs/EVALUATION.md](docs/EVALUATION.md)。
102
- **English**: Details in [docs/EVALUATION.md](docs/EVALUATION.md).
103
 
104
- ---
105
-
106
- ## 训练 / 微调 (Training & Fine-tuning)
107
-
108
- **中文**:997 张人工标注验证码,CNN 从零训练(位置保留架构)。
109
- **English**: 997 manually-labeled captchas, CNN trained from scratch (position-preserving architecture).
110
-
111
- - 数据 / Data: `data/` (997 labeled images)
112
- - 脚本 / Scripts: `scripts/train_fixed.py`
113
- - 指南 / Guide: [docs/TRAINING.md](docs/TRAINING.md)
114
 
115
- ---
116
-
117
- ## 说明 / Notes
118
 
119
- **中文**:
120
- - 验证码为 PHPWind 内置组件(非站点定制)。
121
- - 不同 PHPWind 版本参数可能有差异,换站使用前建议对比样例确认风格。
122
 
123
- **English**:
124
  - The captcha is PHPWind's built-in component (not site-custom).
125
- - Different PHPWind versions may differ; compare samples before use on another site.
126
-
127
- ---
128
 
129
- ## 许可证 / License
130
 
131
- **中文**:本模型采用 **GNU AGPL-3.0** 许可 —— 可自由使用、修改、分发(含商用),但修改版/衍生作品必须同样以 AGPL 开源;网络服务使用也需提供源码。详见 [LICENSE](LICENSE)。
132
- **English**: Licensed under the **GNU AGPL-3.0** — free to use, modify and distribute (including commercial use), provided modified/derivative works stay AGPL-licensed; network-server use must offer source. See [LICENSE](LICENSE).
 
1
  ---
2
  language:
 
3
  - en
4
  license: agpl-3.0
5
  tags:
 
14
  - name: "validation accuracy"
15
  type: accuracy
16
  value: 0.886
17
+ - name: "per-attempt login success"
18
  type: accuracy
19
  value: 0.876
20
  - name: "login success with retries"
 
24
 
25
  # PHPWind Captcha OCR
26
 
27
+ An OCR model for the built-in **PHPWind forum captcha** (4 digits). Fully local inference, no external API, 4 MB ONNX model.
 
28
 
29
+ **中文版**: [README_zh.md](README_zh.md)
 
 
 
 
 
30
 
31
  ![example captcha](assets/example_captcha.png)
32
 
33
  ```
34
+ Example input → Model output: 9125
35
  ```
36
 
37
+ This captcha is PHPWind's built-in component (`PwVerifyCode` / `PwGDCode`). Colored digits, noise lines and distortion are its standard features.
 
 
 
38
 
39
+ ## Quick Start
40
 
41
  ### Python (onnxruntime)
42
 
 
64
 
65
  See [docs/INFERENCE.md](docs/INFERENCE.md).
66
 
67
+ ## I/O Specification
 
 
68
 
69
+ | Item | Spec |
70
  |---|---|
71
+ | Input `input` | `[batch, 3, 64, 160]` float32, RGB, values in `[0, 1]` |
72
+ | Output `logits` | `[batch, 4, 10]`, argmax per position → digit |
73
+ | ONNX opset | 18 |
74
+ | Preprocessing | RGB → resize 160x64 (BILINEAR) → divide by 255 |
 
 
75
 
76
+ ## Evaluation
77
 
78
+ Evaluated against **real forum logins** (login success = correct recognition). Details in [docs/EVALUATION.md](docs/EVALUATION.md).
 
79
 
80
+ | Metric | Value |
81
  |---|---|
82
+ | Validation accuracy | 88.6% |
83
+ | Per-attempt login success | **87.6%** (85/97) |
84
+ | Login success with retries | ≈99.9997% |
85
 
86
+ ## Training & Fine-tuning
 
87
 
88
+ 997 manually-labeled captchas, CNN trained from scratch with a position-preserving architecture.
 
 
 
 
 
 
 
 
 
89
 
90
+ - Data: `data/` (997 labeled images)
91
+ - Script: `scripts/train_fixed.py`
92
+ - Guide: [docs/TRAINING.md](docs/TRAINING.md)
93
 
94
+ ## Notes
 
 
95
 
 
96
  - The captcha is PHPWind's built-in component (not site-custom).
97
+ - Different PHPWind versions may differ; compare samples before using on another site.
 
 
98
 
99
+ ## License
100
 
101
+ GNU AGPL-3.0 — free to use, modify and distribute (including commercial use), provided modified/derivative works stay AGPL-licensed; network-server use must offer source. See [LICENSE](LICENSE).