1 Star 0 Fork 95

ryvius_key / tr

forked from myhub / OCR 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

tr - Text Recognition

Tested under Python3 with Ubuntu 16.04 and Ubuntu 18.04

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

说明

经过半年时间的测试与bug修复,目前本软件运行稳定,可放心在实际项目中使用
授权协议:Apache License, Version 2.0

TODO

  • Use ONNX Runtime instead of libtorch

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"))

效果展示


空文件

简介

Free Offline OCR 离线的中文文本检测+识别SDK 展开 收起
Python
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Python
1
https://gitee.com/ryvius_key/tr.git
git@gitee.com:ryvius_key/tr.git
ryvius_key
tr
tr
master

搜索帮助