• Stars
    star
    115
  • Rank 304,140 (Top 7 %)
  • Language Vue
  • License
    Apache License 2.0
  • Created almost 3 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

开源的中英文离线 OCR,使用 PaddleOCR 实现,提供了简单的 Web 页面及接口

PaddleWebOCR

开源的中英文离线 OCR,使用 PaddleOCR 实现,提供了简单的 Web 页面及接口。

An opensource offline multi-languages OCR system shipped with RESTful api and web page.

介绍

使用了开源的 PaddleOCR 并内置了多个模型,可以在离线环境下运行,并且相关资料丰富便于自行训练模型。PaddleOCR 本身支持中文简体繁体,英文,韩文等等多种语言,本项目只内置了中英文(简体中文和繁体中文)的模型,如需要识别其它语言,可以参考本项目调整模型。

web页面

特性

  • 中文简体/繁体,英语等多语种识别

安装需求

运行平台

  • ✔ Python 3.7+
  • ✔ Windows 10/11
  • ✔ CentOS 7
  • ✔ MacOS Big Sur
  • ✔ Docker

Windows、CentOS 和 MacOS 系统下在安装好依赖之后可以直接运行,目前只构建了 paddlepaddle 的 CPU 版本,不支持 GPU。也过通过构建 Docker 镜像或者直接从 DockerHub 拉去镜像来使用。

最低配置要求

  • CPU: 2 核
  • 内存: 4GB

安装说明

服务器部署

  1. 安装好 nodejs 之后进入 webui 目录
cd webui
npm install
npm run build
  1. 安装 python 3.7

  2. 安装依赖包

pip install -r requirements.txt
  1. 运行,项目默认运行在 8080 端口:
uvicorn paddlewebocr.main:app --host 0.0.0.0 --port 8080


#或者

PYTHONPATH="${PYTHONPATH}:." python paddlewebocr/main.py [--port=8080]

Docker 部署

推荐从 DockerHub pull 运行镜像

docker run -d -p 8080:8080 -v ${PWD}/logs:/app/logs --name paddlewebocr lewangdev/paddlewebocr:latest

使用脚本构建本地镜像(因为要编译 GCC,整个构建过程非常漫长)

# Dockerfile 构建
./build-docker-image.sh

# 运行镜像
docker run -d -p 8080:8080 -v ${PWD}/logs:/app/logs --name paddlewebocr paddlewebocr:latest 

接口调用示例

  • Python 使用 File 上传文件
import requests
url = 'http://127.0.0.1:8080/api/ocr'
img1_file = {
    'img_upload': open('img1.png', 'rb')
}
res = requests.post(url=url, data={'compress': 0}, files=img1_file)
  • Python 使用 Base64
import requests
import base64


def img_to_base64(img_path):
    with open(img_path, 'rb')as read:
        b64 = base64.b64encode(read.read())
    return b64


url = 'http://127.0.0.1:8080/api/ocr'
img_b64 = img_to_base64('./img1.png')
res = requests.post(url=url, data={'img_b64': img_b64})

效果展示

英文文档识别

中文文档识别

验证码识别

验证码识别

火车票

火车票

发票

身份证

海报

更新记录

查看更新记录

致谢

本项目参考了 TrWebOCR,由于 TrWebOCR 启动时需要联网并且它使用的 Tr 相关的资料比较少,故而尝试使用 paddlepaddlepaddleocr 来替换 Tr, 从而有了本项目。

License

Apache 2.0

More Repositories

1

gost-install.ipynb

通过 Jupyter Notebook 安装 GOST
Jupyter Notebook
684
star
2

autotranslate

Videos Transcription and Translation with Faster Whisper and ChatGPT
Jupyter Notebook
233
star
3

youtube-drive

Store files as YouTube videos == infinite disk space. youtube-drive is totally inspired by YouTubeDrive.
Python
211
star
4

scel2txt

搜狗细胞词库转鼠须管(Rime)词库
Python
180
star
5

shanghai-lockdown-covid-19

Coronavirus (COVID-19) statistics data in Shanghai lockdown. 封控期间上海疫情数据,包括病例数、死亡数、确诊数、无症状数和疫情地址等。
HTML
159
star
6

ShadowsocksX-NG-GostPlugin

ShadowsocksX-NG 的 gost 插件脚本,方便在 ShadowsocksX-NG 中使用 gost
Shell
119
star
7

chatglm2-6b-colab

Colab for chatglm2-6b
Jupyter Notebook
72
star
8

MQTT-Web-Terminal

Bring any Linux device/server to the web, whenever they have public ip or not
Python
41
star
9

bookbookgo_bot

A Telegram bot for book-searcher. Create and search books index, create your private library on Telegram.
Python
38
star
10

certbot-self-hosting

A certbot container is used similarly to acme.sh
Shell
20
star
11

Alacritty.icns

一组 Alacritty 图标
18
star
12

paipai

上海车牌沪牌拍牌助手(不能使用了,仅供参考)
Python
15
star
13

miniblog

A miniblog demo powered by web.py and rye
Python
11
star
14

meow

Meow~喵~是一个面向新手的 Git/GitHub/GitLab 团队开发协作修炼场所
Python
7
star
15

rime_dict_maker

A tool to make your rime dict
Python
7
star
16

jsmwlwedding

A simple parallax scrolling website for my wedding
SCSS
5
star
17

CN-Traffic-Tickets-Query-Adapter

A pyAdapter for querying traffic tickets in China
Python
3
star
18

picb0

Free Pictures Hosting On Github/Statically
Shell
3
star
19

nucintosh

Nucintosh - Hackintosh on Intel NUC8i5BEH/NUC8i7BEH
2
star
20

rtl8723bu

RTL8723BU WiFi Linux Driver v5.2.17.1 for Raspberry Pi
C
2
star
21

pyqt5-examples

PyQt5 示例
Python
2
star
22

WGD-gobinet

MeiG SLM750 GobiNet Driver for Linux
C
2
star
23

jwow

A very simple non-blocking http server
Java
1
star
24

tesla-instrument-panel

Instrument Panel for Tesla Model 3/Y
JavaScript
1
star
25

akoola_tv

An android app plays like a TV remote controller
Java
1
star
26

lewangdev.github.io

Personal Blog of Le
HTML
1
star
27

catcatgo

Catcatgo, 猫猫快跑 is a fast & simple static site generator powered by Python 3.
HTML
1
star
28

ggwave-fork

C++
1
star
29

folotoy-tool

Flasher tool for FoloToys, running in web browser using WebSerial.
Vue
1
star