Model reference · open weights
txtcaptcha-crnn is an open-weight language model from jtrecenti. AxForge deploys and operates it for you on dedicated EU-owned hardware — with the licence handled where one is required.
Available as managed deployment — configured and operated for you on dedicated EU hardware, quoted per deployment.
What it is
| Released by | jtrecenti |
|---|---|
| Type | Language models |
| Task | Image→text |
| Parameters (lead) | 5M |
| Runs with | pytorch |
| Released | 2026-04-11 |
| Popularity | 551 downloads / month |
| Licence | Open weights |
About
A Convolutional Recurrent Neural Network (ResNet-style CNN → BiLSTM → CTC)
trained jointly on ten labeled captcha datasets from Brazilian courts and
tax authorities, published originally by the R
captcha package. It replaces ten
per-site CNN classifiers with a single model that reads variable-length
alphanumeric strings from arbitrarily-sized input images.
from txtcaptcha import decrypt, read_captcha
cap = read_captcha("captcha.png")
# First call downloads the weights from this repo into ~/.cache/huggingface;
# subsequent calls are free.
print(decrypt(cap)) # greedy CTC decoding
print(decrypt(cap, length=5)) # force exactly 5 output chars
print(decrypt(cap, mask="[0-9]")) # restrict to digits
Explicit download (useful for notebooks or CI warmup):
from txtcaptcha import from_pretrained
model = from_pretrained("jtrecenti/txtcaptcha-crnn")
Install txtcaptcha:
pip install git+https://github.com/jtrecenti/txtcaptcha
Merged union of these datasets (published at https://github.com/decryptr/captcha/releases):
cadesp, esaj, jucesp, rfb, sei, tjmg, tjpe, tjrs, trf5, trt
Labels follow the filename convention _.. Vocabulary is
the full alphanumeric range 0-9a-zA-Z (62 classes + CTC blank).
| Stage | Details |
|---|---|
| Backbone | ResNet-style CNN, channels 64 → 128 → 256 → 256, H/8 × W/4 downsample |
| Sequence head | 2-layer bidirectional LSTM, hidden 256 |
| Classifier | Linear 512 → 63 (62 chars + blank) |
| Loss | CTC, handles variable output length |
| Input | Any dimensions; height resized to 32 at inference, width preserved |
The full config is in config.json.
~89% captcha-level exact match on a held-out 20% split of the training
corpus. Per-dataset breakdown available in
notebooks/eval_per_dataset.ipynb.
sei dataset is a math captcha; the model learned to transcribe
the (already-solved) label as if it were a plain 4-char sequence.decrypt(..., length=N) to enforce an exact length.Pin to a specific release with revision=:
from_pretrained("jtrecenti/txtcaptcha-crnn", revision="v0.1.0")
MIT. The original training data from the R captcha package is redistributed
under its own terms.
From the published model card. Full card on the HuggingFace links in the sidebar.
How it works
Using it via the API
Once AxForge deploys txtcaptcha-crnn for you, it answers on the OpenAI-compatible API — the same base URL and keys as every other model. (txtcaptcha-crnn below is illustrative; you get the exact model name on deployment.)
$ curl -sS https://api.axforge.ai/v1/chat/completions \
-H "Authorization: Bearer $AXFORGE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"txtcaptcha-crnn","messages":[{"role":"user","content":"Hello"}]}'
Create an account — your API key is available in the console. 3M free tokens every 30 days with every new account.