文字识别 python离线_GitHub - yxonic/tr: Free Offline OCR 离线的中文文本检测+识别SDK

tr - Text Recognition

Tested under Python3 with Ubuntu 16.04 and Ubuntu 18.04

一款针对扫描文档的离线文本识别SDK,核心代码全部采用C++开发,并提供Python接口

说明

由于时间有限,暂停Windows版本的维护,将专心开发Linux版本

当前版本为测试版,不适合在实际项目中使用

Requirements

pip install numpy Pillow opencv-python

Install

安装方法一

git clone https://github.com/myhub/tr.git

cd ./tr

sudo python setup.py install

安装方法二

pip install git+https://github.com/myhub/tr.git@master

测试是否安装成功

python test.py

python test_angle.py

How To Use?

import tr

# detect text lines, return list of (x, y, width, height)

print(tr.detect("imgs/web.png"))

# 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, return list of ((x, y, width, height), text, confidence)

print(tr.run("imgs/name_card.jpg"))

# detect and recognize text lines with angle, return list of ((cx, cy, width, height, angle), text, confidence)

print(tr.run_angle("imgs/id_card.jpeg"))

TODO

检测带角度的文本框

识别部分支持带角度的文本框

优化识别部分代码

支持表格检测

识别英文空格

支持GPU/手机端

效果展示

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值