← all repositories
sml2h3/ddddocr

Offline CAPTCHA recognition without the SaaS meter running

ddddocr exists so your Python scripts can read distorted CAPTCHA text locally instead of feeding images to a metered cloud API.

14.5k stars Python Computer Vision
ddddocr
Velocity · 7d
+4.6
★ / day
Trend
steady
star history

What it does

DdddOcr is a Python SDK that performs offline optical character recognition on CAPTCHA images—those deliberately distorted strings of letters, numbers, Chinese characters, and symbols designed to stop bots. It bundles pretrained ONNX models and runs entirely on local hardware, falling back to CPU if you lack a CUDA setup. Beyond simple text, it also handles slider-captcha gap detection and generic object-detection mode for images that need locating rather than reading.

The interesting bit

The project was trained on massive volumes of synthetically generated random data, which is exactly the kind of adversarial self-inflicted wound CAPTCHAs deserve. It exposes a single DdddOcr class that toggles between OCR, detection, and slider-matching modes through constructor flags rather than forcing you to juggle separate pipelines.

Key highlights

  • Runs fully offline with bundled common_old.onnx and optional common.onnx (beta) models
  • Supports alphanumeric, Chinese, and special-character CAPTCHAs out of the box
  • GPU acceleration available via onnxruntime-gpu, with multi-GPU device_id selection
  • Imports custom ONNX models (with charset JSON) when the built-in weights aren’t enough
  • Cross-platform for Windows 64-bit, Linux 64/ARM64, and macOS x64 up to Python 3.12

Caveats

  • Initialization is slow enough that the README explicitly warns you to reuse a single instance
  • The FAQ admits accuracy can be mediocre on complex or unusual CAPTCHAs
  • Sponsor ads print to stdout by default unless you pass show_ad=False

Verdict

Worth a look for scrapers, test suites, and internal automation that wrestle with legacy image CAPTCHAs and prefer a local, one-time download to a cloud API. Look elsewhere if you need bulletproof recognition against heavily obfuscated or behavioral challenges without custom retraining.

Frequently asked

What is sml2h3/ddddocr?
ddddocr exists so your Python scripts can read distorted CAPTCHA text locally instead of feeding images to a metered cloud API.
Is ddddocr open source?
Yes — sml2h3/ddddocr is open source, released under the MIT license.
What language is ddddocr written in?
sml2h3/ddddocr is primarily written in Python.
How popular is ddddocr?
sml2h3/ddddocr has 14.5k stars on GitHub and is currently holding steady.
Where can I find ddddocr?
sml2h3/ddddocr is on GitHub at https://github.com/sml2h3/ddddocr.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.