Python安装PaddleOCR

安装PaddleOCR-2.7.0版本-笔记 阅读详情
AI摘要

本文对比了PaddleOCR、EasyOCR、Tesseract-OCR和Surya等四种流行的OCR工具,并详细介绍了PaddleOCR的安装和使用方法。

注意:我的系统是Ubuntu18.4

1 介绍

光学字符识别(Optical Character Recognition,OCR )主要用于图片中文本识别。目前开源的OCR识别工具比较多,比较出名的有PaddleOCR、EasyOCR、Tesseract-OCR和Surya等。

PaddleOCR由百度基于PaddlePaddle使用Python编写和训练的开源OCR项目,提供了多种尺寸和语种的模型,效果很不错,提供了Python包可直接使用,不仅提供了布局识别、文档识别,还提供了表格识别。

# GitHub地址
https://github.com/PaddlePaddle/PaddleOCR

EasyOCR由Jaided AI使用Python编写的OCR项目,支持80多种语言,提供了Python包,可直接使用,效果也很不错。

# Github地址
https://github.com/JaidedAI/EasyOCR

# 官网地址
https://www.jaided.ai/

Tesseract-OCR由Google主要使用C++编写的开源OCR项目,它提供了超过130种语言和35种脚本的软件包,可以在Linux、Windows和Mac等平台上运行。

缺点:需要在相应平台上自己手动安装和编译,没有直接提供Python和Java的使用方式,没有提供表格识别等,有一个基于tesseract-ocr的开源项目pytesseract可以使用Python调用。

# Github项目地址
https://github.com/tesseract-ocr

# 开源源代码
https://github.com/tesseract-ocr/tesseract

# 开发文档地址
https://tesseract-ocr.github.io/tessdoc/

Surya由个人开源的使用Python编写和训练的开源OCR项目,提供了90多种语言的识别,主要用于文档OCR识别、提供了布局识别和文本识别等。

# Github地址
https://github.com/VikParuchuri/surya

2 安装PaddleOCR

# 安装paddlepaddle(我用的是cpu版本)
python3 -m pip install paddlepaddle -i https://mirror.baidu.com/pypi/simple

# 安装gpu版本paddlepaddle
python3 -m pip install paddlepaddle-gpu -i https://mirror.baidu.com/pypi/simple
# 安装paddleocr
pip install paddleocr

安装时出现的问题

主要是安装python-Levenshtein引起的问题,直接安装XX.tar.gz文件是不行的,可以安装XX.linux.whl文件应该可以(但是我没找到linux版本)。

fatal error: Python.h: No such file or directory
#include <Python.h>
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

解决办法

# 一般情况下,直接安装下面的即可,建议用指定python版本的方法
sudo apt-get install python-dev

# 如果还不行,安装时指定python版本,不指定python版本可能还出现问题
sudo apt-get install python3.8-dev

3 PaddleOCR使用

from paddleocr import PaddleOCR, draw_ocr

# 'use_gpu=False'不用gpu,默认使用GPU
# 'use_angle_cls=True'自动下载相关的包
# 'lang="ch"'设置语言,支持中英文、英文、法语、德语、韩语、日语,参数依次为`ch`, `en`, `french`, `german`, `korean`, `japan`。
# 离线使用时,设置模型的目录det_model_dir、rec_model_dir、cls_model_dir第一次联网模型会自动下载到model目录下
ocr = PaddleOCR(use_gpu=False, use_angle_cls=True, lang="ch", det_model_dir="./model/det", rec_model_dir="./model/rec/", cls_model_dir="./model/cls/")
img_path = './picture/my_001.png'
result = ocr.ocr(img_path, cls=True)

# line是一个列表' [[文本框的位置],(文字,置信度)] '
for line in result:
    print(line)
离线部署PaddleOCR 在ubuntu16.04上离线安装paddleocr以及sanic框架 阅读详情

相关推荐

Win10-Python37-安装paddleocr及paddlepaddle

python ocr paddlepaddle paddleocr

weixin_45054115的博客 1951

正确安装PaddleOCR的方法

记录安装paddleorc踩过的坑

weixin_44063045的博客 7823

【Python】PaddleOCR文字识别国产之光 从安装到pycharm中测试 (保姆级图文)

【Python】PaddleOCR文字识别国产之光 从安装到pycharm中测试 (保姆级图文)

MZH 9114

PaddleOCR安装教程(一)

PaddleOCR安装教程(一)

m0_55776553的博客 6283

从理论到实践:使用Sigrity SystemSI完成DDR4信号完整性仿真全流程解析

本文详细解析了使用Sigrity SystemSI完成DDR4信号完整性仿真的全流程,从核心挑战到实战操作。文章深入探讨了DDR4信号完整性问题,介绍了SystemSI工具链的演进与分工,并提供了从前期准备到高级技巧的详细指南,帮助工程师有效解决DDR4设计中的信号完整性问题。

weixin_30505225的博客 511

浮点数运算的陷阱与启示:FP16加法器/乘法器开发中的常见误区

本文深入探讨FP16加法器和乘法器开发中的常见误区,包括FP16格式解析、阶码对齐陷阱、尾数运算风险及规格化处理。通过Verilog实战代码展示防御性编程技巧,帮助开发者避免边界条件处理和异常状态管理中的错误,提升硬件设计的可靠性和效率。

dell8的博客 250

已解决Python正确安装paddleocr库

已解决(Python正确paddleocr库) error: subprocess-exited-with-error × Running setup.py install for python-Levenshtein did not run successfully. × Encountered error while trying to install package. ╰─> python-Levenshtein note: This is an issue with the package ment

努力让自己发光,对的人才能迎着光而来 1万+

Unity Hub报错The Hub as encountered a critical error and must close

如果注册表HKEY_LOCAL_MACHINE\SOFTWARE\Unity Technologies\这个目录下有Hub文件,直接删掉然后重装就可以。C:\Users\Administrator\AppData\Roaming\Unity 作者:SevenVee。HKEY_CURRENT_USER\Software\Unity 下所有项,尝试过,卸载重装,清除临时文件无果后,最终决定删除所有与Hub有关的文件。重装unity后可以打开了。结果:卸载重装后还是会出现此问题。结果:重装后还是无法解决。

qq_42345116的博客 3638

python库paddleocr的安装步骤记录

paddleocr库的安装教程,用python进行本地批量ocr识别

IMmmma的博客 4898

【调试记录】GT ip跑aurora 64b66b协议

如果不用,会出现这种情况:自回环测试,数据收发ok.一旦和对方通信,对方接收的就是一堆乱码,因为GT链路发送数据不能是全1或全0,或者长时间的1或0.否则线路容易受到干扰,毕竟线速率10多G,用了加扰和解扰,就可以提高抗干扰能力。64B66B编码,数据输入是64bit,输出是66bit,所以这之间存在着2bit的带宽差,Gearbox 就是用来解决这种差异的,实现方式是:将66bit数据拿出来2bit先存入Gearbox,然后输出64bit.发送同步码或控制数据时,配置成2.2.4 加扰和解扰!

weixin_41246509的博客 1602

电竞护航系统成品搭建俱乐部点单小程序开发三角洲小程序搭建

电竞护航系统成品搭建俱乐部点单小程序开发三角洲小程序搭建

dapengglove的博客 1682

python安装paddleocr报错

原因是:下载完成之后,新建python文件或者文件夹,命名为paddleocr.py。所以新建的文件名一定不能和python三方包的名字一样。下载paddleocr和ppstructure之后,一直报错。

qq_41810188的博客 812

别再折腾端口了!Kali Nethunter Kex 图形化桌面连接失败的真正原因与一键修复(附Termux命令)

本文深入分析了Kali Nethunter Kex图形化桌面连接失败的真正原因,包括端口配置变更、依赖缺失和权限问题,并提供了一键修复方案和Termux命令。通过详细的诊断步骤和优化配置,帮助用户快速恢复Kex功能,提升移动安全测试效率。

weixin_42530732的博客 417

python3.7中安装paddleocr以及paddlepaddle包

升级pip pip版本必须升级到20.0.4版本才能应用; 方法一、在pycharm中对pip进行升级; 方法二、通过命令进行升级 python3.7 -m pip install --upgrade pip 下载paddleOCR 下载链接:https://github.com/PaddlePaddle/PaddleOCR 打开paddleOCR文件夹中requirements.txt文件,更改文件中opencv-python为opencv-python == 4.2.0.32,因为支

xp_fangfei的博客 8412

TIBCO Jaspersoft Studio报表开发 使用教程-进阶版

本文学习内容容器定制二级目录三级目录 容器定制 二级目录 三级目录

吉哲的博客 7521

Coze 打通飞书多维表格,实现数据增删改查操作实战详解

基于Coze 打通飞书多维表实现数据录入系统实战详解

congge 5780

paddlepaddle测试安装_python3.7中安装paddleocr及paddlepaddle包的多种方法

升级pippip版本必须升级到20.0.4版本才能应用;方法一、在pycharm中对pip进行升级;方法二、通过命令进行升级python3.7 -m pip install --upgrade pip下载paddleOCR下载链接:https://github.com/PaddlePaddle/PaddleOCR打开paddleOCR文件夹中requirements.txt文件,更改文件中open...

weixin_28932927的博客 1189

VC中sqlite的使用

在VC中对sqlite的使用,实现数据库大批数据的快速插入,读取数据库中的数据在ListCtrl中显示

服务器win10server,python安装paddleocr的踩坑日记

最近由于需要图像文字识别的简单业务,研究了一下,一是用大厂的文字识别api,如百度腾讯等,但这种免费版只有有限的调用次数,如百度只有每月只有1000次调用额度,个人也够用,但由于业务量大,所以再看看其他本地识别的模型,现在做的比较完善的就是paddleocr,于是开始了一段折磨之旅paddleocr官方github:我的安装在云服务器win10 server2022版,在此之前已经安装了python3.12.3,所以只需要安装paddleocr即可。

y5946的博客 2059

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

计算机控制技术及应用

《计算机控制技术及应用》通过总结作者的科研成果和吸收国内外的先进理论、方法和技术,以计算机控制系统的网络化、开放化、智能化和集成化发展趋势为主线索,主要介绍计算机控制系统的基本概念和计算机控制系统的典型形式,计算机控制系统的数学描述与基本分析方法,以及数字PID控制器、最少拍控制系统、达林算法、状态变量设计法等设计方法及其各种改进算法。重点突出计算机控制系统输入输出通道接口的设计方法和典型控制系统的设计案例与实现方法等。

win10(python) 安装paddleocr

win10 安装paddleocr

qq_35685734的博客 940

迈瑞BS系列全自动生化分析仪LIS协议接口手册(内含HL7和ASTM)

迈瑞BS系列全自动生化分析仪LIS协议接口手册,内含HL7和ASTM)

xp python3.7_python3.7中安装paddleocr及paddlepaddle包的多种方法

升级pippip版本必须升级到20.0.4版本才能应用;方法一、在pycharm中对pip进行升级;方法二、通过命令进行升级python3.7 -m pip install --upgrade pip下载paddleOCR下载链接:https://github.com/PaddlePaddle/PaddleOCR打开paddleOCR文件夹中requirements.txt文件,更改文件中open...

weixin_42347882的博客 334

Python3.10.9安装paddleocr识别jpg图片文字,windows10

只有这个ocr测试完成。Windows10系统,cpu支持avx,无独立显卡,使用cpu集成显卡 这个ocr测试安装软件少,硬件要求低,相对简单容易成功,python3.10.9,cmd命令行操作pip,

ddcar的博客 1264

已解决(paddleocr库安装报错) error: subprocess-exited-with-error × Running setup.py install for python-Leve

已解决(paddleocr库安装报错) error: subprocess-exited-with-error × Running setup.py install for python-Levenshtein did not run successfully. × Encountered error while trying to install package. ╰─> python-Levenshtein note: This is an issue with the package ment

努力让自己发光,对的人才能迎着光而来 1万+

PaddleOCR+Python安装依赖关系

pip 自动升级依赖 → 把 numpy 升到 2.x → 全部炸↓自动安装 imgaug↓自动升级 numpy → 2.x↓imgaug / opencv 崩👉先锁 numpy 1.x再装其他包(全部禁止依赖升级)

weixin_37394614的博客 471

ipad pycharm_在Python 3.7中安装飞桨和PADLIPADLE包,python37,paddleocr,以及,paddlepaddle

升级pippip版本必须升级到20.0.4版本才能应用;方法一、在pycharm中对pip进行升级;方法二、通过命令进行升级python3.7 -m pip install --upgrade pip下载paddleOCR下载链接:https://github.com/PaddlePaddle/PaddleOCR打开paddleOCR文件夹中requirements.txt文件,更改文件中open...

weixin_35140642的博客 1935

在ubuntu16.04 基于ros和python2.7安装百度paddlepaddle框架及文字识别paddleocr

在ubuntu16.04 基于ros和python2.7安装百度paddlepaddle框架及文字识别paddleocr 第一步: 下载PaddleOCR 1、PaddleOCR是基于飞桨开源的深度学习框架PaddlePaddle的一个文字识别系统。 打开Github地址 为 https://github.com/PaddlePaddle/PaddleOCR 打开上面的网址,在release那里选择 1.1版本或者是develop版本,然后点那个code 选择https 复制那个链接,接着打开一个终端

qq_46135284的博客 2224
上一篇: python中线程和协程
下一篇: 简单使用OnlyOffice
MasonYyp
博客等级 码龄9年 301粉丝 297原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值