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

做海报素材网站推荐seo矩阵培训

做海报素材网站推荐,seo矩阵培训,做微商在哪个网站打广告好,dreamweaver教程做网站在riscv编译安装飞桨PaddlePaddle参见: 算能RISC-V通用云编译飞桨paddlepaddleopenKylin留档_在riscv下进行paddlelite源码编译-CSDN博客 安装好飞桨,就可以用飞桨进行推理了。刚开始计划用ONNX推理,但是在算能云没有装上,所以最…

在riscv编译安装飞桨PaddlePaddle参见:

算能RISC-V通用云编译飞桨paddlepaddle@openKylin留档_在riscv下进行paddlelite源码编译-CSDN博客

安装好飞桨,就可以用飞桨进行推理了。刚开始计划用ONNX推理,但是在算能云没有装上,所以最终是用的飞桨推理。但是还是用到了Paddle2ONNX里的代码。

下载Paddle2ONNX源代码

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

ocr文字识别

下面是使用ONNX进行推理的示例,我没有弄成,希望有成功的朋友交流下经验。

安装需要的库

pip install shapely pyclipper

如果在riscv系统无法编译安装shapely,那么可以先安装包:

apt install libgeos-dev

下载相关模型文件

cd Paddle2ONNX/model_zoo/ocr# 下载det模型
wget https://bj.bcebos.com/paddle2onnx/model_zoo/ch_PP-OCRv2_det_infer.onnx# 下载rec模型
wget https://bj.bcebos.com/paddle2onnx/model_zoo/ch_PP-OCRv2_rec_infer.onnx# 下载cls模型
wget https://bj.bcebos.com/paddle2onnx/model_zoo/ch_ppocr_mobile_v2.0_cls_infer.onnx

进行识别

python3 infer.py  \
--det_model_dir=./ch_PP-OCRv2_det_infer.onnx  \
--rec_model_dir=./ch_PP-OCRv2_rec_infer.onnx  \
--cls_model_dir=./ch_ppocr_mobile_v2.0_cls_infer.onnx  \
--image_path=./images/lite_demo.png

使用飞桨推理进行文字识别

这个推理成功了。

下载和解压模型

wget -nc  -P ./inference https://bj.bcebos.com/paddle2onnx/model_zoo/ch_PP-OCRv2_det_infer.tar
cd ./inference && tar xf ch_PP-OCRv2_det_infer.tar && cd ..wget -nc  -P ./inference https://bj.bcebos.com/paddle2onnx/model_zoo/ch_PP-OCRv2_rec_infer.tar
cd ./inference && tar xf ch_PP-OCRv2_rec_infer.tar && cd ..wget -nc  -P ./inference https://bj.bcebos.com/paddle2onnx/model_zoo/ch_ppocr_mobile_v2.0_cls_infer.tar
cd ./inference && tar xf ch_ppocr_mobile_v2.0_cls_infer.tar && cd ..

进行文字识别

python3 infer.py \
--cls_model_dir=./inference/ch_ppocr_mobile_v2.0_cls_infer \
--rec_model_dir=./inference/ch_PP-OCRv2_rec_infer \
--det_model_dir=./inference/ch_PP-OCRv2_det_infer \
--image_path=./images/lite_demo.png \
--use_paddle_predict=True

推理识别结果

输出可紧致头发磷层,从而达到0.99444813即时持久改善头发光泽的效果,给干燥的头0.99019814发足够的滋养0.997668花费了0.457335秒

效果还不错

调试

ocr读取文件的时候报错:

Python 3.11.0rc2 (main, Sep  4 2023, 07:22:49) [GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/root/py311/lib/python3.11/site-packages/cv2/__init__.py", line 8, in <module>
    from .cv2 import *
ImportError: libtiff.so.6: cannot open shared object file: No such file or directory

安装libtiff

pip install pylibtiff

结果还是报错

找到libtiff.so.5文件在/lib/riscv64-linux-gnu,做了个链接。

  ln -s libtiff.so.5 libtiff.so.6

报错ImportError: libgtk-x11-2.0.so.0

SyntaxError: invalid syntax
(py311) root@863c89a419ec:~/github/Paddle2ONNX/model_zoo/ocr# python -c "import cv2"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/root/py311/lib/python3.11/site-packages/cv2/__init__.py", line 8, in <module>
    from .cv2 import *
ImportError: libtiff.so.6: cannot open shared object file: No such file or directory
(py311) root@863c89a419ec:~/github/Paddle2ONNX/model_zoo/ocr# python -c "import cv2"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/root/py311/lib/python3.11/site-packages/cv2/__init__.py", line 8, in <module>
    from .cv2 import *
ImportError: libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directory

安装包:apt-get install libgtk2.0-dev

ok了

识别是numpy.int报错

    File "/root/github/Paddle2ONNX/model_zoo/ocr/utils/predict_det.py", line 210, in box_score_fast
    xmin = np.clip(np.floor(box[:, 0].min()).astype(np.int), 0, w - 1)

File "/usr/local/lib/python3.8/dist-packages/numpy/__init__.py", line 305, in __getattr__
    raise AttributeError(__former_attrs__[attr])

AttributeError: module 'numpy' has no attribute 'int'.
`np.int` was a deprecated alias for the builtin `int`. To avoid this error in existing code, use `int` by itself. Doing this will not modify any behavior and is safe. When replacing `np.int`, you may wish to use e.g. `np.int64` or `np.int32` to specify the precision. If you wish to review your current use, check the release note link for additional information.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:

进入/root/github/Paddle2ONNX/model_zoo/ocr/utils/predict_det.py源码,把np.int都改成np.int32

http://www.mmbaike.com/news/36915.html

相关文章:

  • 做网站申请域名2022百度收录越来越难了
  • 专业做简历的网站火星培训机构收费明细
  • 网络服务提供者发现未成年通过网络诈骗某网站seo诊断分析
  • 做电源的网站百度网盘客服24小时电话人工服务
  • 如何做好公司网站建设内容企业推广
  • 网站的大图标怎么做跨境电商哪个平台比较好
  • wordpress后台菜单添加设置按钮seo数据分析哪些方面
  • 独立网站建设步骤网络竞价
  • 深圳网站建设费用大概下载百度网盘app
  • 做网站设计需要多少钱近期新闻热点大事件
  • 浏览器直接进入网站在百度怎么发布作品
  • 企业网站怎么推广友情链接怎么添加
  • 利用php做网站百度收录情况查询
  • 北京学网站开发做一个网站要多少钱
  • 爬知乎文章做网站seo学校培训班
  • 网站怎样做seo视频广告
  • 重庆主城区疫情最新消息seo内部优化包括哪些内容
  • 网站制作中英文天津有哪些平台可以发布推广信息
  • 建企业版网站多久软文平台有哪些
  • 淘宝建站服务仁茂网络seo
  • 网页设计与制作智慧树单元检测答案seo博客
  • 国家标准下载网免费商丘seo优化
  • p2p网站如何做推广百度数据开放平台
  • 找国外供应商去哪个网站最新舆情信息网
  • js可以做动态网站吗合肥网站设计
  • 网站建设项目的费用做什么科目酒店网络营销推广方式
  • 怎么做存储网站百度上海总部
  • 建设银行网站用户权限谷歌广告上海有限公司
  • 阿里巴巴网站维护要怎么做企业网站推广的方法
  • b2b商城网站建设seo关键词优化工具