# tr - Text Recognition
一款针对扫描文档的离线文本识别SDK,核心代码全部采用C++开发,并提供Python接口
#### 更新说明
+ c++接口支持
+ 支持Windows系统
+ 添加python2支持
+ 去除opencv-python、Pillow依赖,降低部署难度
+ 支持多线程
+ 支持GPU
#### Contact
Email: [email protected]
#### Requirements
+ Windows 7+/Ubuntu 16.04/Ubuntu 18.04
+ python2/python3,需要安装numpy
+ Windows系统需要安装[VC_redist.x64.exe](https://download.visualstudio.microsoft.com/download/pr/89a3b9df-4a09-492e-8474-8f92c115c51d/B1A32C71A6B7D5978904FB223763263EA5A7EB23B2C44A0D60E90D234AD99178/VC_redist.x64.exe
)
#### GPU版本安装说明
如果对速度有要求,推荐安装GPU版本<br>
要使用GPU版本,复制tr_gpu文件夹里面的文件到tr文件夹<br>
注意: 需要先安装CUDA 10.1以及cuDNN 7.6.5<br>
<br>
若不想安装CUDA/cuDNN,可以使用docker部署
<pre>docker pull mcr.microsoft.com/azureml/onnxruntime:v1.3.0-cuda10.1-cudnn7
sudo nvidia-docker run -v /path/to/tr:/path/to/tr --rm -it mcr.microsoft.com/azureml/onnxruntime:v1.3.0-cuda10.1-cudnn7
</pre>
#### Install
+ 安装方法一
<pre>git clone https://github.com/myhub/tr.git
cd ./tr
sudo python setup.py install
</pre>
+ 安装方法二
<pre>sudo pip install git+https://github.com/myhub/tr.git@master
</pre>
#### Test
<pre>
python2 demo.py # python2兼容测试
python3 test.py # 可视化测试
python3 test-multi-thread.py # 多线程测试
</pre>
#### 关联项目
+ 若需要Web端调用,推荐参考<a href="https://github.com/alisen39/TrWebOCR">TrWebOCR</a>
#### Python Example
<pre>import tr
# detect text lines, return list of (cx, cy, width, height, angle)
print(tr.detect("imgs/web.png", tr.FLAG_RECT))
# detect text lines with angle, return list of (cx, cy, width, height, angle)
print(tr.detect("imgs/id_card.jpeg", tr.FLAG_ROTATED_RECT))
# recognize text line, return (text, confidence)
print(tr.recognize("imgs/line.png"))
# detect and recognize text lines with angle, return list of ((cx, cy, width, height, angle), text, confidence)
print(tr.run("imgs/id_card.jpeg"))
</pre>
#### C++ Example
<pre>tr_init(0, 0, "crnn.bin", NULL);
#define MAX_WIDTH 512
int unicode[MAX_WIDTH];
float prob[MAX_WIDTH];
auto ws = tr_recognize(0, (void *)"line.png", 0, 0, 0, unicode, prob, MAX_WIDTH);
tr_release(0);
</pre>
#### 效果展示
<img src="https://gitee.com/microic/tr/raw/master/imgs/output/id_card/1.png" />
<img src="https://gitee.com/microic/tr/raw/master/imgs/output/id_card/2.png" />
<hr>
<img src="https://gitee.com/microic/tr/raw/master/imgs/output/name_card/1.png" />
<img src="https://gitee.com/microic/tr/raw/master/imgs/output/name_card/2.png" />
没有合适的资源?快使用搜索试试~ 我知道了~
tr:免费离线OCR离线的中文文本检测+识别SDK

共28个文件
png:6个
py:6个
bin:2个

需积分: 43 44 下载量 40 浏览量
2021-02-06
00:51:54
上传
评论 1
收藏 143.12MB ZIP 举报
温馨提示
tr-文字识别 单一针对扫描文档的离线文本识别SDK,核心代码全部采用C ++开发,并提供Python接口 更新说明 c ++接口支持 支持Windows系统 添加python2支持 删除opencv-python,Pillow依赖,降低部署难度 支持多线程 支持GPU 联系 电子邮件: 要求 Windows 7 + / Ubuntu 16.04 / Ubuntu 18.04 python2 / python3,需要安装numpy Windows系统需要安装 GPU版本安装说明 如果对速度有要求,推荐安装GPU版本要使用GPU版本,复制tr_gpu文件夹里面的文件到tr文件夹注意:需要先
资源详情
资源评论
资源推荐
收起资源包目录




































共 28 条
- 1

























MorisatoGeimato
- 粉丝: 57
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助


最新资源
- 网吧网络组建方案.doc
- 基因工程医学知识讲座.pptx
- 全新悲伤的网络签名唯美句子.docx
- 软件学院卓越工程师教育培养计划工作进展报告.doc
- 通用原厂诊断仪MDIGDSTISWEB使用培训.pptx
- 公司网络管理规划.docx
- 计算机专业高校生社会实践报告.docx
- 精选银行计算机实习总结报告范文.docx
- 2023年软件测试与质量保证试题参考.doc
- 通信工程概预算考试试题与答案(基础题与专业题).doc
- 医学统计学及其软件包专家讲座.pptx
- 2023年招标师项目管理与招标采购模拟试题二.doc
- 工程技术人员及项目管理人员培训需求调查表.doc
- 图书馆管理系统数据库设计(word文档良心出品).doc
- cppweb-C语言资源
- 电子商务专业毕业设计样本.doc
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈



安全验证
文档复制为VIP权益,开通VIP直接复制

评论0