## 本项目基于[chineseocr](https://github.com/chineseocr/chineseocr) 与[psenet](https://github.com/WenmuZhou/PSENet.pytorch) 实现中文自然场景文字检测及识别
# 环境
- pytorch 1.2.0
- python3
- linux/macos/windows
- windows环境配置参考热心网友的文章[Python构建快速高效的中文文字识别OCR](https://blog.csdn.net/lly1122334/article/details/104752851) 👍
- 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 <container id>`进入容器,然后`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 编译
``` Bash
cd psenet/pse
rm -rf pse.so
make
```
# 实现功能
- [x] 提供轻量的backone检测模型psenet(8.5M),crnn_lstm_lite(9.5M) 和行文本方向分类网络(1.5M)
- [x] 任意方向文字检测,识别时判断行文本方向
- [x] crnn\crnn_lite lstm\dense识别(ocr-dense和ocr-lstm是搬运[chineseocr](https://github.com/chineseocr/chineseocr)的)
- [x] 支持竖排文本识别
- [x] ncnn 实现 (支持lstm) nihui大佬实现的[crnn_lstm推理](https://github.com/ouyanghuiyu/chineseocr_lite/pull/41) 具体操作详解: [详细记录超轻量中文OCR LSTM模型ncnn实现](https://zhuanlan.zhihu.com/p/113338890?utm_source=qq&utm_medium=social&utm_oi=645149500650557440)
- [x] 提供竖排文字样例以及字体库(旋转90度的字体)
- [ ] mnn 实现
# 2020.03.16更新
- psenet ncnn核扩展实现,有效解决粘连文本检测问题,详见[ncnn ocr一条龙](https://github.com/ouyanghuiyu/chineseocr_lite/tree/master/ncnn_project/ocr)
- nihui大佬实现的[crnn_lstm推理](https://github.com/ouyanghuiyu/chineseocr_lite/pull/41) 具体操作详解: [详细记录超轻量中文OCR LSTM模型ncnn实现](https://zhuanlan.zhihu.com/p/113338890?utm_source=qq&utm_medium=social&utm_oi=645149500650557440)
# 2020.03.12更新
- 升级crnn_lite_lstm_dw.pth模型crnn_lite_lstm_dw_v2.pth , 精度更高
## 竖排字体样式:
<img width="300" height="200" src="https://github.com/ouyanghuiyu/chineseocr_lite/blob/master/vertical_text_fonts/imgs/test.jpg"/>
## 竖排生成的竖排文本样例:
<img width="256" height="32" src="https://github.com/ouyanghuiyu/chineseocr_lite/blob/master/vertical_text_fonts/imgs/00156360.jpg"/>
<img width="256" height="32" src="https://github.com/ouyanghuiyu/chineseocr_lite/blob/master/vertical_text_fonts/imgs/00000027.jpg"/>
<img width="256" height="32" src="https://github.com/ouyanghuiyu/chineseocr_lite/blob/master/vertical_text_fonts/imgs/00156365.jpg"/>
<img width="256" height="32" src="https://github.com/ouyanghuiyu/chineseocr_lite/blob/master/vertical_text_fonts/imgs/00187940.jpg"/>
## web服务启动
``` Bash
cd chineseocr_lite## 进入chineseocr目录
python app.py 8080 ##8080端口号,可以设置任意端口
```
## 访问服务
http://127.0.0.1:8080/ocr
## 识别结果展示
<img width="500" height="300" src="https://github.com/ouyanghuiyu/chineseocr_lite/blob/master/test_imgs/5_res.jpg"/>
<img width="500" height="300" src="https://github.com/ouyanghuiyu/chineseocr_lite/blob/master/test_imgs/4_res.jpg"/>
<img width="500" height="300" src="https://github.com/ouyanghuiyu/chineseocr_lite/blob/master/test_imgs/1_res.jpg"/>
<img width="500" height="300" src="https://github.com/ouyanghuiyu/chineseocr_lite/blob/master/test_imgs/2_res.jpg"/>
<img width="500" height="300" src="https://github.com/ouyanghuiyu/chineseocr_lite/blob/master/test_imgs/3_res.jpg"/>
## ncnn检测识别展示(x86 cpu 单进程)
<img width="500" height="300" src="https://github.com/ouyanghuiyu/chineseocr_lite/blob/master/ncnn_project/ocr/res_imgs/res_3.jpg"/>
<img width="500" height="300" src="https://github.com/ouyanghuiyu/chineseocr_lite/blob/master/ncnn_project/ocr/res_imgs/res_2.jpg"/>
## 参考
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
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
chineseocr_lite-master.zip (272个子文件)
1 5B
libncnn.a 2.33MB
crnn_lite_lstm_vertical.bin 9.06MB
crnn_lite_lstm_v2.bin 9.06MB
crnn_lite_dw_dense.bin 8.87MB
crnn_lite_dw_dense_vertical.bin 8.87MB
psenet_lite_mbv2.bin 7.85MB
shufflenetv2_05_angle.bin 1.3MB
feature_tests.bin 12KB
ompver_CXX.bin 8KB
CMakeDetermineCompilerABI_CXX.bin 8KB
ompver_C.bin 8KB
CMakeDetermineCompilerABI_C.bin 8KB
CMakeCCompilerId.c 20KB
feature_tests.c 688B
OpenMPCheckVersion.c 609B
OpenMPTryFlag.c 122B
cmake.check_cache 85B
CMakeCXXCompiler.cmake 5KB
ncnn.cmake 3KB
Makefile.cmake 3KB
CMakeCCompiler.cmake 2KB
cmake_install.cmake 2KB
DependInfo.cmake 807B
ncnn-release.cmake 777B
CMakeDirectoryInformation.cmake 706B
CMakeSystem.cmake 398B
cmake_clean.cmake 278B
ncnnConfig.cmake 197B
main.cpp 23KB
CMakeCXXCompilerId.cpp 19KB
ocr.cpp 18KB
ocr_back.cpp 18KB
RRLib.cpp 10KB
main.cpp 9KB
psenet.cpp 7KB
pse.cpp 3KB
OpenMPCheckVersion.cpp 609B
main.cpp 536B
OpenMPTryFlag.cpp 122B
checkbox.css 10KB
feature_tests.cxx 10KB
Dockerfile 3KB
loading.gif 4KB
pybind11.h 91KB
cast.h 87KB
numpy.h 64KB
pytypes.h 55KB
mat.h 55KB
Matrix.h 55KB
common.h 36KB
eigen.h 28KB
class.h 24KB
class_support.h 23KB
stl_bind.h 21KB
attr.h 19KB
Rect.h 18KB
init.h 16KB
stl.h 14KB
internals.h 13KB
HalideRuntime.h 11KB
allocator.h 10KB
command.h 9KB
gpu.h 9KB
operators.h 9KB
embed.h 8KB
descr.h 8KB
net.h 7KB
chrono.h 6KB
opencv.h 6KB
iostream.h 5KB
layer.h 4KB
buffer_info.h 4KB
eval.h 4KB
platform.h 4KB
descr.h 3KB
pipeline.h 3KB
polygon.h 3KB
polygon.h 3KB
functional.h 3KB
option.h 3KB
datareader.h 2KB
MNNDefine.h 2KB
options.h 2KB
complex.h 2KB
paramdict.h 2KB
cpu.h 2KB
modelbin.h 2KB
RRLib.h 2KB
MNNForwardType.h 2KB
typeid.h 1KB
typeid.h 1KB
blob.h 1KB
ocr.h 1KB
benchmark.h 1KB
layer_type_enum.h 1KB
layer_type.h 952B
common.h 120B
Interpreter.hpp 8KB
Tensor.hpp 8KB
共 272 条
- 1
- 2
- 3
资源评论
qq_27607229
- 粉丝: 5
- 资源: 12
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于springboot+layui的医院日常耗材管理系统.zip
- 计算机毕业设计-ASP.NET教育报表管理系统-权限管理模块(源代码+)-毕设源码实例.zip
- 计算机毕业设计-ASP.NET教务信息管理系统的设计与实现(源代码+)-毕设源码实例.zip
- Eleven的精益供应链管理-碓胤咨询龚胤全.rar
- 5套光伏、储能、充电收益测算表.zip
- C2 供应链集成演示平台操作手册(详细版).rar
- 3套光储充一体化站CAD+PDF图纸.zip
- Screenshot_20240426_195831_com.huawei.android.launcher.jpg
- 2000-2023年各省专利侵权结案数据.xlsx
- C#使用NPOI操作合并单元格
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功