Upload README.md with huggingface_hub
Browse files
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: "
|
| 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 |
-
**
|
| 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 |

|
| 39 |
|
| 40 |
```
|
| 41 |
-
|
| 42 |
```
|
| 43 |
|
| 44 |
-
|
| 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 |
-
##
|
| 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 |
-
|
|
| 82 |
|---|---|
|
| 83 |
-
|
|
| 84 |
-
|
|
| 85 |
-
| ONNX opset
|
| 86 |
-
|
|
| 87 |
-
|
| 88 |
-
---
|
| 89 |
|
| 90 |
-
##
|
| 91 |
|
| 92 |
-
**
|
| 93 |
-
**English**: Evaluated against real forum logins (login success = correct recognition).
|
| 94 |
|
| 95 |
-
|
|
| 96 |
|---|---|
|
| 97 |
-
|
|
| 98 |
-
|
|
| 99 |
-
|
|
| 100 |
|
| 101 |
-
|
| 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 |
-
|
| 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
|
| 126 |
-
|
| 127 |
-
---
|
| 128 |
|
| 129 |
-
##
|
| 130 |
|
| 131 |
-
|
| 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 |

|
| 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).
|
|
|