skillfed

ddddocr

带带弟弟OCR

ddddocr v1.6.1 416.6K downloads/30d#6,819 on PyPI14,606
Permissive 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) Active released

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 ddddocr

uv

uv add ddddocr

poetry

poetry add ddddocr

Installing 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

License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13

Tags

captcha recognitionocr verification codeimage text detectionoffline captcha solverneural network ocrslide puzzle detectionchinese character recognition
captcha-solvingoffline-mlimage-recognition

More Artificial Intelligence packages