kaptchaocr-tiny-rec / README.md
zaltahir's picture
Add kaptchaocr-tiny-rec model and benchmark card
69958fd verified
|
Raw History Blame Contribute Delete
2.61 kB
---
license: apache-2.0
library_name: onnxruntime
pipeline_tag: image-to-text
tags:
- kaptchaocr
- captcha
- ocr
- onnx
- onnxruntime
- text-recognition
- pp-ocrv6
---
<img src="assets/hero-banner.png" alt="KaptchaOCR" width="100%">
# KaptchaOCR ft-tiny
One of the five fine-tuned **KaptchaOCR** models. This repository contains the
`tiny_rec.onnx` recognizer and its `tiny_rec.json` charset only.
KaptchaOCR is a Rust CAPTCHA library and server:
[github.com/ozalt/kaptchaocr](https://github.com/ozalt/kaptchaocr).
## Model card
| Field | Value |
| --- | --- |
| Task | text recognition (CTC) |
| Base | PP-OCRv6 tiny |
| Profile | `fast` |
| Size | 4.3 MB |
| Input | RGB, height 48, dynamic width |
| Charset | 6,906 characters (`tiny_rec.json`) |
| Training data | 169,311 CAPTCHA images / 194,355 labels (oversampled), case-sensitive, 73 classes |
| Validation | 5,000 images |
The model is inference-only. KaptchaOCR handles preprocessing, CTC decoding
and the HTTP/server layer.
## Benchmark
Held-out CAPTCHA sets, **4,399 images** total. Exact match is the whole string,
case-sensitive. Latency is mean ms/image on an Intel i5-1145G7, single process.
| Set | Exact |
| --- | ---: |
| archive1 | 52% |
| archive2 | 88% |
| archive3 | 95% |
| hammer888 | 42% |
| kaggle | 58% |
| lcsd | 94% |
| **Overall** | **67.0%** |
Character accuracy: **88.8%**. Mean latency: **9.8 ms**.
The test images are image-disjoint from training but come from the same public
sources, so this is not an out-of-distribution benchmark. Full tables, including
the comparison models (ddddocr and PP-OCRv6 base), are in the
[benchmark page](https://github.com/ozalt/kaptchaocr/blob/main/benchmarks/README.md).
## Usage
Use the shipped manifest entry with the KaptchaOCR binary:
```sh
kaptchaocr --ocr --manifest model/models.json --rec-model ft-tiny
```
For a non-inline build, point at this repo's files directly:
```sh
kaptchaocr --ocr --ocr-path tiny_rec.onnx
```
The charset must sit next to the model with the same base name (`tiny_rec.onnx` →
`tiny_rec.json`). Manifest entry:
```json
{"name": "ft-tiny", "task": "rec", "path": "tiny_rec.onnx", "charset": "tiny_rec.json"}
```
## License
Apache-2.0. Fine-tuned from the PP-OCRv6 tiny model
([PaddleOCR](https://github.com/PaddlePaddle/PaddleOCR), Apache-2.0). No
ddddocr weights are included in this repository.
## Links
- [GitHub](https://github.com/ozalt/kaptchaocr)
- [All KaptchaOCR models](https://huggingface.co/collections/zaltahir/kaptchaocr)
- [Benchmarks](https://github.com/ozalt/kaptchaocr/blob/main/benchmarks/README.md)