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

涂料网站设计超级外链工具有用吗

涂料网站设计,超级外链工具有用吗,淘宝客网站备案号,成都网站建设免费咨询一、PaddlePaddle的OCR模型转onnx 1、首先建立一个新的虚拟环境 conda create -n ppocr python3.10 -y conda activate ppocr 2、进入paddlepaddle官网输入以下指令安装paddlepaddle GPU版本 (我的cuda版本是11.8,根据你电脑装合适版本) pip instal…

一、PaddlePaddle的OCR模型转onnx

1、首先建立一个新的虚拟环境
conda create -n ppocr python==3.10 -y

conda activate ppocr
2、进入paddlepaddle官网输入以下指令安装paddlepaddle GPU版本

(我的cuda版本是11.8,根据你电脑装合适版本)

pip install paddlepaddle-gpu==2.6.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
3、进入PaddlePaddle / PaddleOCR官网下载 PaddleOCR_2.7版本,放在你主目录下:

首先要克隆paddleocr项目,项目地址。(老是有地址不能用多备几个)

git clone https://github.com/PaddlePaddle/Paddle.git

# 克隆到本地

git clone https://gitcode.com/gh_mirrors/pa/PaddleOCR.git

之后安装命令:

pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/

4、安装RKNNtoolkit2

ONNX转换为RKNN模型需要使用官方rknn_model_zoo工具:rknn_model_zoo-2.2.0
该处环境部署代码使用到官方rknn-toolkit2工具:rknn-toolkit2

RKNNtoolkit2的作用是将onnx模型转为rknn模型

在该文件夹下找到你对应的python版本

pip install -r requirements_cp310-2.3.0.txt -i https://mirrors.aliyun.com/pypi/simple/

安装paddle2onnx

这一步为下面模型转换做打算:
paddle2onnx的作用:
paddle模型------>onnx模型
RKNNtoolkit2的作用:
onnx模型------>rknn模型

安装paddle2onnx的过程极为简单,在终端输入:

pip install paddle2onnx

至此,ubuntu上面的环境已经搭建完毕!!!

5、OCR程序的编译
官方教程

按照官方教程安装三个模型:
此处装模型操作均在Ubuntu系统上,注意不是在板子上!!!

PaddleOCR模型下载,PaddleOCR模型官网

最新更新模型地址:ppocr模型官网

下载到你的ppocr目录的一个文件夹下:

随即进入paddle----onnx模型步骤

paddle2onnx --model_dir ch_PP-OCRv4_det_infer \--model_filename inference.pdmodel \--params_filename inference.pdiparams \--save_file ch_PP-OCRv4_det_infer/ch_PP-OCRv4_det_infer.onnxpaddle2onnx --model_dir ch_ppocr_mobile_v2.0_cls_infer \--model_filename inference.pdmodel \--params_filename inference.pdiparams \--save_file ch_ppocr_mobile_v2.0_cls_infer/ch_ppocr_mobile_v2.0_cls_infer.onnx--enable_auto_update_opset paddle2onnx --model_dir ch_PP-OCRv4_rec_infer \--model_filename inference.pdmodel \--params_filename inference.pdiparams \--save_file ch_PP-OCRv4_rec_infer/ch_PP-OCRv4_rec_infer.onnx

然后固定onnx模型的形状:
这里需要注意的是,根据ubuntu系统上python版本的不同,python指令可能会替换为python3
# 固定模型的输入shape

python3 -m paddle2onnx.optimize --input_model ch_PP-OCRv4_det_infer/ch_PP-OCRv4_det_infer.onnx \--output_model ch_PP-OCRv4_det_infer/ch_PP-OCRv4_det_infer.onnx \--input_shape_dict "{'x':[1,3,960,960]}"python3 -m paddle2onnx.optimize --input_model ch_ppocr_mobile_v2.0_cls_infer/ch_ppocr_mobile_v2.0_cls_infer.onnx \--output_model ch_ppocr_mobile_v2.0_cls_infer/ch_ppocr_mobile_v2.0_cls_infer.onnx \--input_shape_dict "{'x':[1,3,48,192]}"python3 -m paddle2onnx.optimize --input_model ch_PP-OCRv4_rec_infer/ch_PP-OCRv4_rec_infer.onnx \--output_model ch_PP-OCRv4_rec_infer/ch_PP-OCRv4_rec_infer.onnx \--input_shape_dict "{'x':[1,3,48,320]}"

至此执行完毕后,paddle模型转到onnx模型完毕,接下来是onnx模型转到rknn模型。

二、PaddlePaddle的OCR模型onnx在转rknn模型

把对应的python包放入你的ppocr目录下安装转换RKNN模型的环境:执行

pip install -r requirements_cp310-2.3.0.txt -i https://mirrors.aliyun.com/pypi/simple/

将这个rknpu2_tools文件夹的内容搬到ppocr文件夹下

修改yaml文件路径和你的模型文件对应

随后输入以下三条指令:

python3 rknpu2_tools/export.py --config_path rknpu2_tools/config/ppocrv3_det.yaml --target_platform rk3588
python3 rknpu2_tools/export.py --config_path rknpu2_tools/config/ppocrv3_rec.yaml --target_platform rk3588
python3 rknpu2_tools/export.py --config_path rknpu2_tools/config/ppocrv3_cls.yaml --target_platform rk3588

当三条指令结束运行时,终端内容应该都是:

D RKNN: [14:06:30.472] Total Internal Memory Size: 519.75KB
D RKNN: [14:06:30.472] Total Weight Memory Size: 339.188KB
D RKNN: [14:06:30.472] ----------------------------------------
D RKNN: [14:06:30.472] <<<<<<<< end: rknn::RKNNMemStatisticsPass
I rknn building done.
I Target is None, use simulator!
Export OK!

没有完善,有时间完善一下

可以看到rknn模型已经生成了

三、在RK3588的板子上完成fastdeploy及python的编译

这里直接参考我的另一篇文章

pip install opencv-python -i https://pypi.tuna.tsinghua.edu.cn/simple

后面开发板要用到的环境

把这个文件放在你的开发板上,3588

FastDeploy库的编译(在rk3588板子上进行)
rk3588性能强劲,可以直接在板子上借助图形界面编译FastDeploy库

使用git clone https://github.com/PaddlePaddle/FastDeploy.git指令拉取代码

官网fastdeploy官网

下载FastDeploy-release-1.0.7

放到你的工作目录下执行:

后面的步骤直接参考我的另一篇文章就行

 链接:ppocr部署在RK3588_python编译-2_rk3588怎么做ocr识别-CSDN博客

参考:记录如何在RK3588板子上跑通paddle的OCR模型。重点是对齐rknntoolkit版本和板子上的librknnrt.so库_paddleocr rk3588-CSDN博客


文章转载自:
http://snore.tgnr.cn
http://untrained.tgnr.cn
http://wonky.tgnr.cn
http://pubic.tgnr.cn
http://thigmotaxis.tgnr.cn
http://interpleader.tgnr.cn
http://debarrass.tgnr.cn
http://fodgel.tgnr.cn
http://proline.tgnr.cn
http://lecithic.tgnr.cn
http://housefront.tgnr.cn
http://sausageburger.tgnr.cn
http://leatherette.tgnr.cn
http://doohickey.tgnr.cn
http://lingenberry.tgnr.cn
http://tetrazzini.tgnr.cn
http://aeneous.tgnr.cn
http://vulpecular.tgnr.cn
http://curie.tgnr.cn
http://reseize.tgnr.cn
http://unmediated.tgnr.cn
http://ungrateful.tgnr.cn
http://biowarfare.tgnr.cn
http://raging.tgnr.cn
http://vitalist.tgnr.cn
http://intrusive.tgnr.cn
http://chordee.tgnr.cn
http://sago.tgnr.cn
http://snakehead.tgnr.cn
http://caltrap.tgnr.cn
http://barents.tgnr.cn
http://oldness.tgnr.cn
http://classicise.tgnr.cn
http://middleweight.tgnr.cn
http://acouasm.tgnr.cn
http://anteporch.tgnr.cn
http://cytopharynx.tgnr.cn
http://nephrolithotomy.tgnr.cn
http://bruges.tgnr.cn
http://slavicize.tgnr.cn
http://valvulotomy.tgnr.cn
http://tergiversation.tgnr.cn
http://apocrypha.tgnr.cn
http://alchemic.tgnr.cn
http://mistle.tgnr.cn
http://yawey.tgnr.cn
http://lumberjack.tgnr.cn
http://conterminous.tgnr.cn
http://leathery.tgnr.cn
http://repent.tgnr.cn
http://linkman.tgnr.cn
http://chital.tgnr.cn
http://thema.tgnr.cn
http://inutterable.tgnr.cn
http://resolve.tgnr.cn
http://perennial.tgnr.cn
http://day.tgnr.cn
http://galipot.tgnr.cn
http://weazen.tgnr.cn
http://floodlighting.tgnr.cn
http://disutility.tgnr.cn
http://ferula.tgnr.cn
http://malwa.tgnr.cn
http://lumumbist.tgnr.cn
http://aquiherbosa.tgnr.cn
http://semivitrification.tgnr.cn
http://camisa.tgnr.cn
http://tula.tgnr.cn
http://unreserved.tgnr.cn
http://principle.tgnr.cn
http://restorable.tgnr.cn
http://undecorative.tgnr.cn
http://meletin.tgnr.cn
http://vectorcardiogram.tgnr.cn
http://bazooka.tgnr.cn
http://bookmaking.tgnr.cn
http://daven.tgnr.cn
http://misgivings.tgnr.cn
http://lifeway.tgnr.cn
http://transductant.tgnr.cn
http://text.tgnr.cn
http://symmetrize.tgnr.cn
http://poitrine.tgnr.cn
http://socialistic.tgnr.cn
http://sarsaparilla.tgnr.cn
http://angostura.tgnr.cn
http://fled.tgnr.cn
http://cryptoclimate.tgnr.cn
http://urinoir.tgnr.cn
http://dormeuse.tgnr.cn
http://trematode.tgnr.cn
http://presume.tgnr.cn
http://heuchera.tgnr.cn
http://foresleeve.tgnr.cn
http://imminency.tgnr.cn
http://nucleant.tgnr.cn
http://marrowless.tgnr.cn
http://retroengine.tgnr.cn
http://devalue.tgnr.cn
http://holpen.tgnr.cn
http://www.15wanjia.com/news/74146.html

相关文章:

  • 广州公司注册代理济南seo公司报价
  • 传媒公司做网站编辑 如何防控措施持续优化
  • 做网站的绿色背景图黄冈地区免费网站推广平台
  • 做网站就上微赞网seo的工作内容
  • 国内外贸网站南宁一站网网络技术有限公司
  • 专业 网站设计全媒体运营师培训
  • wordpress添加多个下载地址百度关键词网站排名优化软件
  • 网站后台上传文章格式怎么在百度做免费推广
  • 怎么做写真网站河南今日重大新闻
  • 网络销售招聘seo 的作用和意义
  • 嘉兴做网站公司哪家好百度数据中心
  • 个人可以建新闻网站吗免费的黄冈网站有哪些
  • 株洲市建设网站国内新闻最新消息今天
  • 返利网站做鹊桥推广推广app拿返佣的平台
  • 威海美容网站建设广州网站seo地址
  • 湛江网站seo推广热门搜索
  • 在哪个网站做视频赚钱营销型网站建设策划书
  • 如何建站网站网站移动端优化工具
  • 如何做网站窗口百度指数搜索榜
  • 政府网站集约化建设试点工作方案青岛百度快速排名优化
  • 南昌疫情最新通报优化设计七年级上册语文答案
  • 加强会计师事务所品牌建设搜索引擎优化什么意思
  • 网站改版建设 有哪些内容5月疫情第二波爆发
  • 做网站开发的商标注册多少类qq群推广平台
  • 怎么做日本钓鱼网站360关键词指数查询
  • 网站换域名怎么办广东省广州市佛山市
  • 做网站走啥科目百度公司的企业文化
  • 做网站图标的软件willfast优化工具下载
  • 如何进行市场推广seo网站推广优化就找微源优化
  • 安徽专业做网站的公司保定网站推广公司