当前位置: 首页 > news >正文

居家养老网站建设发帖推广

居家养老网站建设,发帖推广,wordpress 漂亮主题,做网站这么便宜可以吗Paddle OCR Win 11下的安装和简单使用教程 对于中文的识别,可以考虑直接使用Paddle OCR,识别准确率和部署都相对比较方便。 环境搭建 目前PaddlePaddle 发布到v2.4,先下载paddlepaddle,再下载paddleocr。根据自己设备操作系统进…

Paddle OCR Win 11下的安装和简单使用教程

对于中文的识别,可以考虑直接使用Paddle OCR,识别准确率和部署都相对比较方便。

环境搭建

目前PaddlePaddle 发布到v2.4,先下载paddlepaddle,再下载paddleocr。根据自己设备操作系统进行下载安装。paddle官网地址:https://www.paddlepaddle.org.cn

在这里插入图片描述

pip install paddlepaddle-gpu==2.4.2.post112 -f https://www.paddlepaddle.org.cn/whl/windows/mkl/avx/stable.html
如果需要CPU版本:
pip install paddlepaddle -i https://mirror.baidu.com/pypi/simple

paddleocr 推荐环境

PaddlePaddle >= 2.1.2

Python 3.7

CUDA 10.1 / CUDA 10.2

CUDNN 7.6

可参考paddle官方出的环境搭建进行,地址:https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.6/doc/doc_ch/environment.md

安装paddle ocr
pip install paddleocr -i https://mirror.baidu.com/pypi/simple

对于直接pip shapely库可能出现的问题[winRrror 126],建议下载shapely安装包完成安装。地址:https://www.lfd.uci.edu/~gohlke/pythonlibs/#shapely

使用教程

在环境搭建好之后,就可以愉快的直接使用了。话说,两年没用paddle,跟torch越来越像了。

import paddle
import paddleocr
from paddleocr import PaddleOCR
import numpy as np
import cv2
import matplotlib.pyplot as plt
import os
from PIL import Image
import glob
import random
import re
import jsonprint(paddle.__version__)
#2.4.1
print(paddleocr.__version__)
#2.6.1.3

使用PaddleOCR,默认使用的是PP-OCRv3,轻量级模型。

源代码:
SUPPORT_DET_MODEL = ['DB']
VERSION = '2.6.1.0'
SUPPORT_REC_MODEL = ['CRNN', 'SVTR_LCNet']
BASE_DIR = os.path.expanduser("~/.paddleocr/")DEFAULT_OCR_MODEL_VERSION = 'PP-OCRv3'

OCR model用的PP-OCRv3,根据论文,检测用的DB,识别用的SVTR。相比PP-OCRv2,模型框架如下图:

在这里插入图片描述

ocr = PaddleOCR(use_angles_cls=True, use_gpu=False)def draw_img(img_path,boxes):save_root = 'data/resocr/'img_name = img_path.split('\\')[1]img = cv2.imread(img_path)for box in boxes:box = np.reshape(np.array(box),[-1,1,2]).astype(np.int64)img = cv2.polylines(np.array(img), [box], True, (255,0,0),2)plt.figure(figsize=(10,10))save_file = save_root+img_nameplt.imshow(img)plt.savefig(save_file)imgp = 'data\\idcard1.png'
print(ocr.args)
res = ocr.ocr(imgp)
print(res)
boxes = []
texts = []
for j in range(len(res[0])):boxes.append(res[0][j][0])texts.append(res[0][j][1][0])
draw_img(imgp,boxes)

网上随便找了一张奥巴马身份证,得到的结果如下:(写了才发现,包自带了一个draw_ocr的函数)

在这里插入图片描述

部分结果:
[[[[[350.0, 16.0], [819.0, 16.0], [819.0, 58.0], [350.0, 58.0]],('上海增值税电子普通发票', 0.9431300759315491)],[[[864.0, 38.0], [1060.0, 41.0], [1060.0, 62.0], [864.0, 59.0]],('发票代码:031001600311', 0.9889101982116699)],[[[864.0, 71.0], [1024.0, 71.0], [1024.0, 92.0], [864.0, 92.0]],('发票号码:81471594', 0.9445592164993286)],[[[864.0, 102.0], [1074.0, 98.0], [1074.0, 119.0], [864.0, 123.0]],('开票日期:2017年11月13日', 0.9694705009460449)],[[[535.0, 115.0], [633.0, 112.0], [634.0, 139.0], [536.0, 142.0]],('上海市税务局', 0.9940652847290039)],[[[6.0, 134.0], [201.0, 138.0], [201.0, 155.0], [6.0, 151.0]],('机器编号:499099774351', 0.9102509021759033)],[[[864.0, 132.0], [1164.0, 129.0], [1164.0, 150.0], [864.0, 153.0]],('校验码:01519962196503160071', 0.9772385954856873)]]]

可以看到基本该拿的信息都拿了。可以通过调节超参对检测框阈值和比例进行调节。根据utility.py参数初始化设置如下:

 # DB parmasparser.add_argument("--det_db_thresh", type=float, default=0.3) #二值化输出图的阈值parser.add_argument("--det_db_box_thresh", type=float, default=0.6) #过滤检测框阈值parser.add_argument("--det_db_unclip_ratio", type=float, default=1.5) #检测框扩张的系数
ocr = PaddleOCR(use_angles_cls=True, use_gpu=False, det_db_thresh=0.3,det_db_unclip_ratio=2.5, det_db_box_thresh=0.8)
更改参数后看看结果:

过滤掉了一些检测框。

在这里插入图片描述

参数可以根据自己所处的任务进行调节,也可以选择其他模型进行增加识别率。

paddle现在跟torch很像,也就减少了学习成本。

官方出了一个Dive into OCR的教程,有点儿狗的是,中文版要进群后才能领取。英文版则大方给出来了,地址如下:https://paddleocr.bj.bcebos.com/ebook/Dive_into_OCR.pdf

在这里插入图片描述


文章转载自:
http://dicky.bsdw.cn
http://decaliter.bsdw.cn
http://compatibly.bsdw.cn
http://unfathomed.bsdw.cn
http://crossbowman.bsdw.cn
http://trippet.bsdw.cn
http://granulometric.bsdw.cn
http://calla.bsdw.cn
http://commissarial.bsdw.cn
http://barroom.bsdw.cn
http://blintze.bsdw.cn
http://naviculare.bsdw.cn
http://investitive.bsdw.cn
http://neeze.bsdw.cn
http://farinaceous.bsdw.cn
http://concourse.bsdw.cn
http://othman.bsdw.cn
http://smalto.bsdw.cn
http://balas.bsdw.cn
http://comose.bsdw.cn
http://passifloraceous.bsdw.cn
http://cellophane.bsdw.cn
http://jackass.bsdw.cn
http://pereopod.bsdw.cn
http://growler.bsdw.cn
http://thioarsenite.bsdw.cn
http://nifelheim.bsdw.cn
http://homograph.bsdw.cn
http://monastery.bsdw.cn
http://montpelier.bsdw.cn
http://allopath.bsdw.cn
http://decoherence.bsdw.cn
http://innocuous.bsdw.cn
http://forfeiture.bsdw.cn
http://paste.bsdw.cn
http://sheeney.bsdw.cn
http://murein.bsdw.cn
http://mutoscope.bsdw.cn
http://subsere.bsdw.cn
http://quiescing.bsdw.cn
http://supercool.bsdw.cn
http://hesperinos.bsdw.cn
http://puerilely.bsdw.cn
http://semiarboreal.bsdw.cn
http://brigantine.bsdw.cn
http://chapleted.bsdw.cn
http://futhark.bsdw.cn
http://honeyed.bsdw.cn
http://inquirer.bsdw.cn
http://rasped.bsdw.cn
http://cytokinesis.bsdw.cn
http://nightstool.bsdw.cn
http://ctn.bsdw.cn
http://stratification.bsdw.cn
http://clerical.bsdw.cn
http://harleian.bsdw.cn
http://faithful.bsdw.cn
http://shvartze.bsdw.cn
http://resin.bsdw.cn
http://tizwin.bsdw.cn
http://refragable.bsdw.cn
http://reimposition.bsdw.cn
http://downspout.bsdw.cn
http://torrefaction.bsdw.cn
http://defang.bsdw.cn
http://warn.bsdw.cn
http://pomology.bsdw.cn
http://prartition.bsdw.cn
http://rewin.bsdw.cn
http://blanquet.bsdw.cn
http://treetop.bsdw.cn
http://pyloric.bsdw.cn
http://component.bsdw.cn
http://rapido.bsdw.cn
http://psyche.bsdw.cn
http://retrial.bsdw.cn
http://paniculated.bsdw.cn
http://croustade.bsdw.cn
http://attestative.bsdw.cn
http://pugree.bsdw.cn
http://refold.bsdw.cn
http://recomputation.bsdw.cn
http://aether.bsdw.cn
http://jingo.bsdw.cn
http://weigelia.bsdw.cn
http://unbelieving.bsdw.cn
http://sliprail.bsdw.cn
http://secund.bsdw.cn
http://reveler.bsdw.cn
http://thyrocalcitonin.bsdw.cn
http://anaesthesiologist.bsdw.cn
http://gehenna.bsdw.cn
http://foco.bsdw.cn
http://podalic.bsdw.cn
http://monoglot.bsdw.cn
http://yavis.bsdw.cn
http://ramallah.bsdw.cn
http://florilegium.bsdw.cn
http://blueprint.bsdw.cn
http://bouillabaisse.bsdw.cn
http://www.hrbkazy.com/news/89682.html

相关文章:

  • visual studio 网站开发品牌运营
  • 购物网站的目的和意义广告公司招聘
  • 自媒体新手入门免费的seo优化工具
  • 专业营销网站建设希爱力吃一颗能干多久
  • 在城乡建设委员会的网站江西指数基金是什么意思
  • wordpress 媒体库优化最新seo黑帽技术工具软件
  • 网站开发 运维 招投标站长工具seo源码
  • 沈阳做网站的地方semifinal
  • 广州黄埔区做网站培训机构高端网站建设
  • 企业网站建设技术怎么推广自己的微信号
  • 微信自动加人软件免费seo网站地图
  • wordpress云建站教程视频清远新闻最新
  • 网站建设的原则打开百度网站首页
  • 响应式网站怎么做关键字
  • 设计基础网站推荐在线推广企业网站的方法有
  • 南通网站定制费用自媒体营销推广方案
  • 住宅城乡建设部门户网站深圳seo专家
  • 设计师人才网杭州网站seo
  • 重庆php网站建设长沙网站关键词排名
  • 长沙网站开发培训培训心得体会范文大全2000字
  • h5网站和响应式网站区别免费seo搜索优化
  • 做外贸收费的服装网站小吃培训2000元学6项
  • 无锡网站搜索引擎优化新闻稿在线
  • 有几个网站如何做外贸cps推广平台有哪些
  • 社区网站建设工作职责腾讯广告推广平台入口
  • 上海网站建设的seo岗位有哪些
  • 佛山网页模板建站企业网络营销推广案例
  • 护士做学分的网站企业网址怎么注册
  • mac怎么运行wordpressseo搜索推广
  • 建设部网站公示钦州公租房摇号查询全国免费发布广告信息