Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

超轻量级中文ocr,支持竖排文字识别, 支持ncnn推理 , psenet(8.5M) + crnn(6.3M) + anglenet(1.5M) 总模型仅17M

License

Notifications You must be signed in to change notification settings

vanchan5/chineseocr_lite

Repository files navigation

本项目基于chineseocrpsenet 实现中文自然场景文字检测及识别

环境

  • pytorch 1.2.0

  • python3

  • linux/macos/windows

  • windows环境配置参考热心网友的文章Python构建快速高效的中文文字识别OCR 👍

  • Docker 环境

    1. 可以直接在项目根目录下面运行docker build -t my/chineseocr . 构建运行环境的镜像,也可以

      使用其他已经构建好的镜像docker run -dit -p 8080:8080 -v /mnt/d/data/:/data --name chineseocr vitzy/chineseocr_lite

    2. 可通过docker attach --sig-proxy=false <container id> 或者docker exec -it <your container name or id> /bin/bash进入容器,然后git clone https://github.com/ouyanghuiyu/chineseocr_lite拉取本项目代码到/data

    3. cd 到chineseocr_lite下进行安装:pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt

    4. 启动 web python3 app.py 8080, 在浏览器中打开 http://127.0.0.1:8080/ocr

PSENET 编译

cd psenet/pse
rm -rf pse.so 
make 

实现功能

  • 提供轻量的backone检测模型psenet(8.5M),crnn_lstm_lite(9.5M) 和行文本方向分类网络(1.5M)
  • 任意方向文字检测,识别时判断行文本方向
  • crnn\crnn_lite lstm\dense识别(ocr-dense和ocr-lstm是搬运chineseocr的)
  • 支持竖排文本识别
  • ncnn 实现 (支持lstm) nihui大佬实现的crnn_lstm推理 具体操作详解: 详细记录超轻量中文OCR LSTM模型ncnn实现
  • 提供竖排文字样例以及字体库(旋转90度的字体)
  • mnn 实现

2020年03月16日更新

2020年03月12日更新

  • 升级crnn_lite_lstm_dw.pth模型crnn_lite_lstm_dw_v2.pth , 精度更高

竖排字体样式:

竖排生成的竖排文本样例:

web服务启动

cd chineseocr_lite## 进入chineseocr目录
python app.py 8080 ##8080端口号,可以设置任意端口

访问服务

http://127.0.0.1:8080/ocr

识别结果展示

ncnn检测识别展示(x86 cpu 单进程)

参考

  1. ncnn https://github.com/Tencent/ncnn
  2. crnn https://github.com/meijieru/crnn.pytorch.git
  3. chineseocr https://github.com/chineseocr/chineseocr
  4. Psenet https://github.com/WenmuZhou/PSENet.pytorch
  5. 语言模型实现 https://github.com/lukhy/masr

About

超轻量级中文ocr,支持竖排文字识别, 支持ncnn推理 , psenet(8.5M) + crnn(6.3M) + anglenet(1.5M) 总模型仅17M

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 80.5%
  • Python 8.9%
  • JavaScript 4.4%
  • C 2.0%
  • CMake 1.9%
  • Makefile 1.0%
  • Other 1.3%

AltStyle によって変換されたページ (->オリジナル) /