Captcha resolver architecture

OCR Captcha Router

A lightweight shared-style captcha router that downloads the selected TrOCR expert on first use. Hugging Face caches downloaded experts locally, and the resolver uses a confidence and grammar-based dual-model fallback for uncertain routes.

Source models

  • Router: arkhabbazan/ocr-captcha-router
  • Math OCR: arkhabbazan/ocr-match-captcha
  • Digit OCR: anuashok/ocr-captcha-v3

Usage

from resolver import CaptchaResolver

resolver = CaptchaResolver.from_pretrained(
    "arkhabbazan/ocr-captcha-router",
    token=True,
    math_confidence_threshold=0.85,
)
print(resolver.predict("captcha.jpeg"))

Keep the captcha at its original aspect ratio. The resolver pads only the router input and leaves OCR preprocessing to each TrOCR processor. The first request for each route downloads that expert; later requests reuse the in-memory model and Hugging Face cache. math_confidence_threshold accepts a value from 0.0 to 1.0; it is the minimum router probability required to choose the math result when both expert outputs match their valid formats.

Downloads last month
60
Safetensors
Model size
2.26M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for arkhabbazan/ocr-captcha-router

Finetuned
(84)
this model