ddddocr
带带弟弟OCR
What it is and what it does
ddddocr is an offline, local captcha recognition library that uses pre-trained neural network models to identify text and objects in images. It handles common alphanumeric captchas, Chinese characters, slider puzzles, and special characters without requiring external API calls. The library wraps ONNX Runtime models and depends on numpy, Pillow, and OpenCV for image processing.
You initialize it once, then call `classification()` on image bytes to get recognized text. It supports multiple modes—standard OCR, object detection, slider matching—and allows GPU acceleration if you have CUDA available. The package also provides probability distributions per character and lets you constrain recognition to specific character sets, useful when you know the captcha format in advance.
Use it for:
- Automate login flows that require solving simple alphanumeric captchas in web scraping or testing
- Batch-process captcha images offline without hitting rate limits or costs of external OCR services
- Detect and locate objects or text regions in images for accessibility or content moderation workflows
- Recognize Chinese character captchas or mixed-language verification codes in regional applications
- Match slider puzzle gaps by comparing edge patterns between template and target images
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Recognizes text and detects objects in captcha images using offline neural network models, supporting digits, letters, Chinese characters, and slider captchas.
Yes, if you need offline captcha recognition and accept the trade-off that accuracy depends on model fit to your specific captcha style. The permissive MIT license, active maintenance, low install friction, and no known vulnerabilities make it a reasonable choice for development and production. Start with the default model; if accuracy is poor, try the beta model or train a custom one.
Install
ddddocr on PyPI
pip
pip install ddddocruv
uv add ddddocrpoetry
poetry add ddddocrInstalling ddddocr
Before you install
Low friction install with pure-Python wheel and five runtime dependencies (numpy, onnxruntime, Pillow, opencv-python variants). Active maintenance with recent commits and 14606 GitHub stars.
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.
Quickstart
pip install ddddocr
import ddddocr
ocr = ddddocr.DdddOcr()
with open('captcha.jpg', 'rb') as f:
result = ocr.classification(f.read())
print(result)
Requires Python 3.10 or later; GPU acceleration needs CUDA and onnxruntime-gpu separately installed.
Verify before relying
- Actual recognition accuracy rates across different captcha types and complexity levels
- Memory footprint and latency benchmarks for batch processing
- Whether custom model training via dddd_trainer is documented and accessible
Package facts
| License | The MIT License (MIT) Copyright © 2022 <copyright holders> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — numpy, onnxruntime, Pillow, opencv-python, opencv-python-headless |
| Maintenance | actively maintained — 156 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 416,565/month — #6,819 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: ddddocr-1.6.1-py3-none-any.whl
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
qrdetDetects and segments QR codes in images using a…
permissive · top 15,000 on PyPI
perceptronPerceptron is a Python SDK for building…
unclear · top 15,000 on PyPI
rapidocr-onnxruntimePerforms optical character recognition (OCR) on…
permissive · top 5,000 on PyPI
surya-ocrSurya is an OCR and document intelligence model…
permissive · top 5,000 on PyPI
anticaptchaofficialSolves CAPTCHAs and related challenges (image…
permissive · top 15,000 on PyPI
qreaderQReader detects and decodes QR codes from…
permissive · top 15,000 on PyPI
paddlexPaddleX is a low-code framework for training,…
permissive · top 5,000 on PyPI
easyocrEasyOCR performs optical character recognition…
permissive · top 5,000 on PyPI
captchaGenerates audio and image CAPTCHAs for use in…
permissive · top 15,000 on PyPI
onnxtrOnnxTR extracts and recognizes text from…
permissive · top 15,000 on PyPI