当前位置: 首页> 娱乐> 明星 > 宁波数控机械加工网_多用户建站系统源码_建站之星官方网站_百度首页关键词优化

宁波数控机械加工网_多用户建站系统源码_建站之星官方网站_百度首页关键词优化

时间:2025/7/11 23:56:47来源:https://blog.csdn.net/NF_ALONG/article/details/146230752 浏览次数:1次
宁波数控机械加工网_多用户建站系统源码_建站之星官方网站_百度首页关键词优化

一、安装 Miniconda(轻量版 Conda)​

paddlex CPU版本使用avx指令加速,需要确保系统和CPU支持avx指令(centos 7不支持)。

检查是否支持avx指令

dmesg | grep -i avx

查看 x86还是arm

uname -m

1. 下载 Miniconda 安装脚本

 wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh

2. 运行安装脚本

bash Miniconda3-latest-Linux-x86_64.sh
Miniconda3 will now be installed into this location:
/home/super/miniconda3[/home/super/miniconda3] >>> 
PREFIX=/home/super/miniconda3

3. 激活 Conda

 source ~/.bashrc  # 若使用 Bash

4. 验证安装

conda --version

二、使用 Conda 安装 Python 3.10.0

1. 创建独立环境(推荐)​

conda create -n PaddleImageOcr python=3.10.15

2. 激活环境

conda activate PaddleImageOcr

3. 验证 Python 版本

python --version

三、配置 Conda 镜像源(国内加速)​

1. 生成镜像配置文件

 conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/mainconda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/rconda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2conda config --set show_channel_urls yes

2. 查看配置

conda config --show channels

四、安装 PaddlePaddle

临时切换国内源

export PIP_INDEX_URL=https://mirrors.aliyun.com/pypi/simple

CPU 版本

  python -m pip install paddlepaddle==3.0.0rc0 -i https://www.paddlepaddle.org.cn/packages/stable/cpu/

GPU 版本,需显卡驱动程序版本 ≥450.80.02(Linux)或 ≥452.39(Windows)

  python -m pip install paddlepaddle-gpu==3.0.0rc0 -i https://www.paddlepaddle.org.cn/packages/stable/cu118/

GPU 版本,需显卡驱动程序版本 ≥545.23.06(Linux)或 ≥545.84(Windows)

  python -m pip install paddlepaddle-gpu==3.0.0rc0 -i https://www.paddlepaddle.org.cn/packages/stable/cu123/

五、安装PaddleX

  pip install https://paddle-model-ecology.bj.bcebos.com/paddlex/whl/paddlex-3.0.0rc0-py3-none-any.whl

六、执行图片OCR

  paddlex --pipeline OCR --input ./20250306-152918.jpg --device cpupaddlex --pipeline OCR --input D:/temp/tess4j/20250306-152918.jpg --device cpu

在这里插入图片描述

输出结果

耗时10s,准确率较高,图片分辨率不高也能识别。
在这里插入图片描述

七、安装Paddle Serving服务端​(需Python环境):

安装服务化部署插件

  paddlex --install serving

启动服务

nohup paddlex --serve --port 8080 --pipeline OCR --device cpu --save_path /tmp/PaddleImageOcr > paddleImageOcr.log 2>&1 &

http请求

curl --location '127.0.0.1:8080/ocr' \
--header 'Content-Type: application/json' \
--data '{"file":"https://oss.xxx.com/image/xxx.jpg"
}'

问题

ERROR: Could not find a version that satisfies the requirement Pillow (from paddlepaddle) (from versions: none)

设定安装源、信任安装源、PIL已被Pillow替代

 pip install Pillow -i http://pypi.tuna.tsinghua.edu.cn/simple/ --trusted-host pypi.tuna.tsinghua.edu.cn
关键字:宁波数控机械加工网_多用户建站系统源码_建站之星官方网站_百度首页关键词优化

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: