Skip to main content

English README (out-dated).

cnocr

cnocrPython 3 下的文字识别Optical Character Recognition,简称OCR)工具包,支持中文英文的常见字符识别,自带了多个训练好的识别模型,安装后即可直接使用。欢迎扫码加入微信交流群:

QQ群二维码

作者也维护 知识星球 CnOCR/CnSTD私享群 ,欢迎加入。知识星球私享群会陆续发布一些CnOCR/CnSTD相关的私有资料,包括更详细的训练教程未公开的模型,使用过程中遇到的难题解答等。本群也会发布OCR/STD相关的最新研究资料。此外,私享群中作者每月提供两次免费特有数据的训练服务

详细文档

CnOcr在线文档

使用场景说明

cnocr 主要针对的是排版简单的印刷体文字图片,如截图图片,扫描件等。目前内置的文字检测和分行模块无法处理复杂的文字排版定位。如果要用于场景文字图片的识别,需要结合其他的场景文字检测引擎使用,例如文字检测引擎 cnstd

示例

图片 OCR结果
docs/examples/helloworld.jpg Hello world!你好世界
docs/examples/chn-00199989.jpg 铑泡胭释邑疫反隽寥缔
docs/examples/chn-00199980.jpg 拇箬遭才柄腾戮胖惬炫
docs/examples/chn-00199984.jpg 寿猿嗅髓孢刀谎弓供捣
docs/examples/chn-00199985.jpg 马靼蘑熨距额猬要藕萼
docs/examples/chn-00199981.jpg 掉江悟厉励.谌查门蠕坑
docs/examples/00199975.jpg nd-chips fructed ast
docs/examples/00199978.jpg zouna unpayably Raqu
docs/examples/00199979.jpg ape fissioning Senat
docs/examples/00199971.jpg ling oughtlins near
docs/examples/multi-line_cn1.png 网络支付并无本质的区别,因为
每一个手机号码和邮件地址背后
都会对应着一个账户--这个账
户可以是信用卡账户、借记卡账
户,也包括邮局汇款、手机代
收、电话代收、预付费卡和点卡
等多种形式。
docs/examples/multi-line_cn2.png 当然,在媒介越来越多的情形下,
意味着传播方式的变化。过去主流
的是大众传播,现在互动性和定制
性带来了新的挑战——如何让品牌
与消费者更加互动。
docs/examples/multi-line_en_white.png This chapter is currently only available in this web version. ebook and print will follow.
Convolutional neural networks learn abstract features and concepts from raw image pixels. Feature
Visualization visualizes the learned features by activation maximization. Network Dissection labels
neural network units (e.g. channels) with human concepts.
docs/examples/multi-line_en_black.png transforms the image many times. First, the image goes through many convolutional layers. In those
convolutional layers, the network learns new and increasingly complex features in its layers. Then the
transformed image information goes through the fully connected layers and turns into a classification
or prediction.

安装

嗯,安装真的很简单。

pip install cnocr

安装速度慢的话,可以指定国内的安装源,如使用豆瓣源:

pip install cnocr -i https://pypi.doubanio.com/simple

注意:请使用 Python3(3.6以及之后版本应该都行),没测过Python2下是否ok。

未来工作

  • 支持图片包含多行文字 (Done)
  • crnn模型支持可变长预测,提升灵活性 (since V1.0.0)
  • 完善测试用例 (Doing)
  • 修bugs(目前代码还比较凌乱。。) (Doing)
  • 支持空格识别(since V1.1.0
  • 尝试新模型,如 DenseNet,进一步提升识别准确率(since V1.1.0
  • 优化训练集,去掉不合理的样本;在此基础上,重新训练各个模型
  • 由 MXNet 改为 PyTorch 架构(since V2.0.0
  • 基于 PyTorch 训练更高效的模型
  • 支持列格式的文字识别

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cnocr-2.1.1.1.tar.gz (56.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cnocr-2.1.1.1-py3-none-any.whl (111.7 kB view details)

Uploaded Python 3

File details

Details for the file cnocr-2.1.1.1.tar.gz.

File metadata

  • Download URL: cnocr-2.1.1.1.tar.gz
  • Upload date:
  • Size: 56.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.3

File hashes

Hashes for cnocr-2.1.1.1.tar.gz
Algorithm Hash digest
SHA256 af62e016bbd13a8500d2b92399bb8b9b5bb80e6ca31be9fa6624ff019be9ab09
MD5 f2099e6907ae0a7bfb7710dd53ab4d47
BLAKE2b-256 45259a22fd7a966ee21901f2280031b8fbcaf2236def8c417b6d2122aa070307

See more details on using hashes here.

File details

Details for the file cnocr-2.1.1.1-py3-none-any.whl.

File metadata

  • Download URL: cnocr-2.1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 111.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.3

File hashes

Hashes for cnocr-2.1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 122f7967047d90d5acea1b4ea73f3aeeff7fa2ada9a3c7f28e97d62ca91a5b34
MD5 5e92f2f207f9c56170dd1aa1eacbe2e5
BLAKE2b-256 d43cb0ef47646d2cc7b4de9db272bc4ed12d4649e624f2c29becc9d75d0c61c3

See more details on using hashes here.

Release history Release notifications | RSS feed

2.3.3

2 files

2.3.2.3

2 files

2.3.2.2

2 files

2.3.2.1

2 files

2.3.2

2 files

2.3.1

2 files

2.3.0.3

2 files

2.3.0.2

2 files

2.3.0.1

2 files

2.3

2 files

2.2.4.2

2 files

2.2.4.1

2 files

2.2.4

2 files

2.2.3.2

2 files

2.2.3.1

2 files

2.2.3

2 files

2.2.2.3

2 files

2.2.2.2

2 files

2.2.2.1

2 files

2.2.2

2 files

2.2.1

2 files

2.2

2 files

2.1.2.1

2 files

2.1.2

2 files

This release

2.1.1.1 This release

2 files

2.1.1

2 files

2.1.0

2 files

2.0.1

2 files

2.0.0

2 files

1.2.3.1

2 files

1.2.3

2 files

1.2.2

2 files

1.2.1

2 files

1.2.0

2 files

1.1.2.1

2 files

1.1.1

2 files

1.1.0

2 files

1.0.0

2 files

0.2.0

2 files

0.1.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page