鲲鹏arm服务器部署paddleOCR

news2024/11/25 22:41:42

1. 部署环境信息查看

1.1 操作系统

$ cat /etc/os-release 
PRETTY_NAME="UnionTech OS Server 20"
NAME="UnionTech OS Server 20"
VERSION_ID="20"
VERSION="20"
ID="uos"
PLATFORM_ID="platform:uel20"
HOME_URL="https://www.chinauos.com/"
BUG_REPORT_URL="https://bbs.chinauos.com/"
VERSION_CODENAME="fuyu"

$ cat /etc/issue
UnionTech OS Server 20 1050e \n \l

uos Server 20 1050e

1.2 CPU

$ lscpu
Architecture:                    aarch64
CPU op-mode(s):                  64-bit
Byte Order:                      Little Endian
CPU(s):                          8
Vendor ID:                       HiSilicon
Model name:                      Kunpeng-920
CPU max MHz:                     2600.0000
CPU min MHz:                     2600.0000
BogoMIPS:                        200.00
L1d cache:                       512 KiB
L1i cache:                       512 KiB
L2 cache:                        4 MiB
L3 cache:                        256 MiB
NUMA node0 CPU(s):               0-7
Vulnerability Itlb multihit:     Not affected
Vulnerability L1tf:              Not affected
Vulnerability Mds:               Not affected
Vulnerability Meltdown:          Not affected
Vulnerability Spec store bypass: Not affected
Vulnerability Spectre v1:        Mitigation; __user pointer sanitization
Vulnerability Spectre v2:        Not affected
Vulnerability Srbds:             Not affected
Vulnerability Tsx async abort:   Not affected
Flags:                           fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma dcpop asimddp asimdfhm

64位arm架构,主频2.6GHz 8线程,L3 256MB,不支持avx指令集

1.3 内存

$ free -m
              total        used        free      shared  buff/cache   available
Mem:          14993         624       13273          25        1094       13964
Swap:          2047           0        2047

14GB可用内存

1.4 存储

$ lsblk -d -o name,size,model
NAME  SIZE MODEL
vda    20G 
vdb   200G 

两块磁盘,看不出磁盘型号,应该是虚拟化的原因

$ df -h
Filesystem                                 Size  Used Avail Use% Mounted on
devtmpfs                                   7.1G     0  7.1G   0% /dev
tmpfs                                      7.4G  192K  7.4G   1% /dev/shm
tmpfs                                      7.4G   25M  7.3G   1% /run
tmpfs                                      7.4G     0  7.4G   0% /sys/fs/cgroup
/dev/mapper/uos_host--10--200--4--96-root  217G  6.5G  210G   3% /
tmpfs                                      7.4G  192K  7.4G   1% /tmp
/dev/vda2                                 1014M  154M  861M  16% /boot
/dev/vda1                                  599M   25M  575M   5% /boot/efi
tmpfs                                      1.5G     0  1.5G   0% /run/user/0
tmpfs                                      1.5G     0  1.5G   0% /run/user/993

根目录下有210GB空间可用,基本不用担心磁盘写满了

2. 安装paddle人工智能框架

2.1 python安装

2.1.1 查看是否安装了python3

$ python3 -V
Python 3.7.9

根据paddlepaddle官方文档提示,arm架构的paddlepaddle至少需要python3.8才能支持,不满足要求。

2.1.1 安装python3.8

 # 安装python编译依赖
 yum -y install gcc make zlib zlib-devel bzip2-devel ncurses-devel libffi libffi-devel sqlite-devel
 # 切换到home目录
 cd /home
 # 下载python3.8.2源码
 wget https://www.python.org/ftp/python/3.8.2/Python-3.8.2.tgz
 # 解压源码
 tar -zxvf Python-3.8.2.tgz 
 # 进入工作目录
 cd Python-3.8.2/
 # 配置安装目录
 ./configure --enable-optimizations --prefix=/usr/local/python3.8.2
 # 编译
 make 
 # 安装二制度文件
 make install
 # 确认安装情况
 cd /usr/local/python3.8.2/
 ./bin/python3
 # 修改环境变量
 vim /etc/profile
 export PATH=/usr/local/python3.8.2/bin:$PATH
 # 重新加置配置文件以使环境变量生效
 source /etc/profile
 # 查询python版本
 $ pythonn3 -V
 Python 3.8.2

python3.8已成功安装

2.2 更新pip3版本

查看arm linux环境下,paddlepaddle 要求的pip3版本至少为:20.2.2+

  • 查看现有pip3版本
$ pip3 -V
pip 19.2.3 from /usr/local/python3.8.2/lib/python3.8/site-packages/pip (python 3.8)

pip3版本不满足要求需要更新

  • 更新pip3
$ python3 -m pip install --upgrade pip
Collecting pip
  Downloading https://files.pythonhosted.org/packages/f4/ab/e3c039b5ddba9335bd8f82d599eb310de1d2a2db0411b8d804d507405c74/pip-24.1.1-py3-none-any.whl (1.8MB)
     |████████████████████████████████| 1.8MB 10kB/s 
Installing collected packages: pip
  Found existing installation: pip 19.2.3
    Uninstalling pip-19.2.3:
      Successfully uninstalled pip-19.2.3
Successfully installed pip-24.1.1
# 更新成功

2.3 安装paddle

# 在线安装
$ pip3 install paddlepaddle==2.6.1 -i https://mirror.baidu.com/pypi/simple/
Collecting https://mirror.baidu.com/pypi/simple/
  Downloading https://mirror.baidu.com/pypi/simple/ (10.4 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 10.4/10.4 MB 8.5 MB/s eta 0:00:00
  ERROR: Cannot unpack file /tmp/pip-unpack-q2uv8iqc/simple.html (downloaded from /tmp/pip-req-build-glcy3jgo, content-type: text/html); cannot detect archive format
ERROR: Cannot determine archive format of /tmp/pip-req-build-glcy3jgo

# 报错,尝试离线安装
$ pip3 install paddlepaddle-2.6.1-cp38-cp38-manylinux2014_aarch64.whl -i https://mirror.baidu.com/pypi/simple/
Looking in indexes: https://mirror.baidu.com/pypi/simple/
Processing ./paddlepaddle-2.6.1-cp38-cp38-manylinux2014_aarch64.whl
Collecting httpx (from paddlepaddle==2.6.1)
  Downloading https://mirror.baidu.com/pypi/packages/41/7b/ddacf6dcebb42466abd03f368782142baa82e08fc0c1f8eaa05b4bae87d5/httpx-0.27.0-py3-none-any.whl (75 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 75.6/75.6 kB 240.9 kB/s eta 0:00:00
Collecting numpy>=1.13 (from paddlepaddle==2.6.1)
  Downloading https://mirror.baidu.com/pypi/packages/25/6f/2586a50ad72e8dbb1d8381f837008a0321a3516dfd7cb57fc8cf7e4bb06b/numpy-1.24.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (14.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 14.0/14.0 MB 6.5 MB/s eta 0:00:00
Collecting Pillow (from paddlepaddle==2.6.1)
  Downloading https://mirror.baidu.com/pypi/packages/fa/20/34bd8b37f19d121b81f79491270c08772907837c85da1e9545a39be870d4/pillow-10.3.0-cp38-cp38-manylinux_2_28_aarch64.whl (4.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.3/4.3 MB 5.4 MB/s eta 0:00:00
Collecting decorator (from paddlepaddle==2.6.1)
  Downloading https://mirror.baidu.com/pypi/packages/d5/50/83c593b07763e1161326b3b8c6686f0f4b0f24d5526546bee538c89837d6/decorator-5.1.1-py3-none-any.whl (9.1 kB)
Collecting astor (from paddlepaddle==2.6.1)
  Downloading https://mirror.baidu.com/pypi/packages/c3/88/97eef84f48fa04fbd6750e62dcceafba6c63c81b7ac1420856c8dcc0a3f9/astor-0.8.1-py2.py3-none-any.whl (27 kB)
Collecting opt-einsum==3.3.0 (from paddlepaddle==2.6.1)
  Downloading https://mirror.baidu.com/pypi/packages/bc/19/404708a7e54ad2798907210462fd950c3442ea51acc8790f3da48d2bee8b/opt_einsum-3.3.0-py3-none-any.whl (65 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 65.5/65.5 kB 534.3 kB/s eta 0:00:00
WARNING: Skipping page https://mirror.baidu.com/pypi/simple/protobuf/ because the GET request got Content-Type: application/octet-stream. The only supported Content-Types are application/vnd.pypi.simple.v1+json, application/vnd.pypi.simple.v1+html, and text/html
INFO: pip is looking at multiple versions of paddlepaddle to determine which version is compatible with other requirements. This could take a while.
ERROR: Ignored the following versions that require a different python version: 1.25.0 Requires-Python >=3.9; 1.25.0rc1 Requires-Python >=3.9; 1.25.1 Requires-Python >=3.9; 1.25.2 Requires-Python >=3.9; 1.26.0 Requires-Python <3.13,>=3.9; 1.26.0b1 Requires-Python <3.13,>=3.9; 1.26.0rc1 Requires-Python <3.13,>=3.9; 1.26.1 Requires-Python <3.13,>=3.9; 1.26.2 Requires-Python >=3.9; 1.26.3 Requires-Python >=3.9; 1.26.4 Requires-Python >=3.9; 2.0.0 Requires-Python >=3.9; 2.0.0b1 Requires-Python >=3.9; 2.0.0rc1 Requires-Python >=3.9; 2.0.0rc2 Requires-Python >=3.9
ERROR: Could not find a version that satisfies the requirement protobuf>=3.20.2; platform_system != "Windows" (from paddlepaddle) (from versions: none)
ERROR: No matching distribution found for protobuf>=3.20.2; platform_system != "Windows"
# 继续报错 protobuf>=3.20.2找不到合适的版本
# 手工找到先安装
pip3 install protobuf-3.20.2-cp38-cp38-manylinux2014_aarch64.whl -i https://mirror.baidu.com/pypi/simple/
Looking in indexes: https://mirror.baidu.com/pypi/simple/
Processing ./protobuf-3.20.2-cp38-cp38-manylinux2014_aarch64.whl
Installing collected packages: protobuf
Successfully installed protobuf-3.20.2
# 安装成功,重新装paddle
$ pip3 install paddlepaddle==2.6.1 -i https://mirror.baidu.com/pypi/simple/
...
Requirement already satisfied: protobuf>=3.20.2 in /usr/local/python3.8.2/lib/python3.8/site-packages (from paddlepaddle==2.6.1) (3.20.2)
Collecting anyio (from httpx->paddlepaddle==2.6.1)
  Downloading https://mirror.baidu.com/pypi/packages/7b/a2/10639a79341f6c019dedc95bd48a4928eed9f1d1197f4c04f546fc7ae0ff/anyio-4.4.0-py3-none-any.whl (86 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 86.8/86.8 kB 649.0 kB/s eta 0:00:00
Collecting certifi (from httpx->paddlepaddle==2.6.1)
  Downloading https://mirror.baidu.com/pypi/packages/5b/11/1e78951465b4a225519b8c3ad29769c49e0d8d157a070f681d5b6d64737f/certifi-2024.6.2-py3-none-any.whl (164 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 164.4/164.4 kB 565.3 kB/s eta 0:00:00
Collecting httpcore==1.* (from httpx->paddlepaddle==2.6.1)
  Downloading https://mirror.baidu.com/pypi/packages/78/d4/e5d7e4f2174f8a4d63c8897d79eb8fe2503f7ecc03282fee1fa2719c2704/httpcore-1.0.5-py3-none-any.whl (77 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 77.9/77.9 kB 679.1 kB/s eta 0:00:00
Collecting idna (from httpx->paddlepaddle==2.6.1)
  Downloading https://mirror.baidu.com/pypi/packages/e5/3e/741d8c82801c347547f8a2a06aa57dbb1992be9e948df2ea0eda2c8b79e8/idna-3.7-py3-none-any.whl (66 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 66.8/66.8 kB 511.6 kB/s eta 0:00:00
Collecting sniffio (from httpx->paddlepaddle==2.6.1)
  Downloading https://mirror.baidu.com/pypi/packages/e9/44/75a9c9421471a6c4805dbf2356f7c181a29c1879239abab1ea2cc8f38b40/sniffio-1.3.1-py3-none-any.whl (10 kB)
Collecting h11<0.15,>=0.13 (from httpcore==1.*->httpx->paddlepaddle==2.6.1)
  Downloading https://mirror.baidu.com/pypi/packages/95/04/ff642e65ad6b90db43e668d70ffb6736436c7ce41fcc549f4e9472234127/h11-0.14.0-py3-none-any.whl (58 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 58.3/58.3 kB 395.0 kB/s eta 0:00:00
Collecting exceptiongroup>=1.0.2 (from anyio->httpx->paddlepaddle==2.6.1)
  Downloading https://mirror.baidu.com/pypi/packages/01/90/79fe92dd413a9cab314ef5c591b5aa9b9ba787ae4cadab75055b0ae00b33/exceptiongroup-1.2.1-py3-none-any.whl (16 kB)
Collecting typing-extensions>=4.1 (from anyio->httpx->paddlepaddle==2.6.1)
  Downloading https://mirror.baidu.com/pypi/packages/26/9f/ad63fc0248c5379346306f8668cda6e2e2e9c95e01216d2b8ffd9ff037d0/typing_extensions-4.12.2-py3-none-any.whl (37 kB)
Installing collected packages: typing-extensions, sniffio, Pillow, numpy, idna, h11, exceptiongroup, decorator, certifi, astor, opt-einsum, httpcore, anyio, httpx, paddlepaddle
Successfully installed Pillow-10.3.0 anyio-4.4.0 astor-0.8.1 certifi-2024.6.2 decorator-5.1.1 exceptiongroup-1.2.1 h11-0.14.0 httpcore-1.0.5 httpx-0.27.0 idna-3.7 numpy-1.24.4 opt-einsum-3.3.0 paddlepaddle-2.6.1 sniffio-1.3.1 typing-extensions-4.12.2
# paddlepaddle安装成功

所以合理的安装顺序是:
先从pypi仓库手工下载paddlepaddle-2.6.1-cp38-cp38-manylinux2014_aarch64.whlprotobuf-3.20.2-cp38-cp38-manylinux2014_aarch64.whl,上传到服务器。
pip3 install protobuf-3.20.2-cp38-cp38-manylinux2014_aarch64.whl -i https://mirror.baidu.com/pypi/simple/
pip3 install paddlepaddle-2.6.1-cp38-cp38-manylinux2014_aarch64.whl -i https://mirror.baidu.com/pypi/simple/
即可完成安装

3. 安装paddleOCR

3.1 安装paddleOCR 2.6.1

$ pip3 install paddleocr==2.7.3  -i https://mirror.baidu.com/pypi/simple/
Looking in indexes: https://mirror.baidu.com/pypi/simple/
Collecting paddleocr==2.7.3
  Downloading https://mirror.baidu.com/pypi/packages/f2/55/0469ebca1d9c581a3fa740621afe96461a0ef450e489e10e278cc17a19ef/paddleocr-2.7.3-py3-none-any.whl (780 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 780.0/780.0 kB 2.7 MB/s eta 0:00:00
Collecting shapely (from paddleocr==2.7.3)
  Downloading https://mirror.baidu.com/pypi/packages/96/ac/3b91deb96b022f3833076893ccf11eebb03d6d0bc1199334badc0515ec85/shapely-2.0.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.4 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.4/2.4 MB 5.4 MB/s eta 0:00:00
Collecting scikit-image (from paddleocr==2.7.3)
  Downloading https://mirror.baidu.com/pypi/packages/fa/2b/ffecc6f29b48d1d46dc3bb7b4c908490260c3a0d69ac2d248d846b90d505/scikit_image-0.21.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (13.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 13.3/13.3 MB 8.2 MB/s eta 0:00:00
Collecting imgaug (from paddleocr==2.7.3)
  Downloading https://mirror.baidu.com/pypi/packages/66/b1/af3142c4a85cba6da9f4ebb5ff4e21e2616309552caca5e8acefe9840622/imgaug-0.4.0-py2.py3-none-any.whl (948 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 948.0/948.0 kB 3.9 MB/s eta 0:00:00
Collecting pyclipper (from paddleocr==2.7.3)
  Downloading https://mirror.baidu.com/pypi/packages/80/a5/acc0e11bf33ff178cc6d97798c15de376af149d6414ee2c5083fb8465fd5/pyclipper-1.3.0.post5-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (932 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 932.3/932.3 kB 3.1 MB/s eta 0:00:00
Collecting lmdb (from paddleocr==2.7.3)
  Downloading https://mirror.baidu.com/pypi/packages/82/af/9971570e8165a28b6eec56fe3a4fd12f62aa70a231650767a0a560743bb0/lmdb-1.4.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (298 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 298.3/298.3 kB 1.1 MB/s eta 0:00:00
Collecting tqdm (from paddleocr==2.7.3)
  Downloading https://mirror.baidu.com/pypi/packages/18/eb/fdb7eb9e48b7b02554e1664afd3bd3f117f6b6d6c5881438a0b055554f9b/tqdm-4.66.4-py3-none-any.whl (78 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 78.3/78.3 kB 1.1 MB/s eta 0:00:00
Requirement already satisfied: numpy in /usr/local/python3.8.2/lib/python3.8/site-packages (from paddleocr==2.7.3) (1.24.4)
Collecting visualdl (from paddleocr==2.7.3)
  Downloading https://mirror.baidu.com/pypi/packages/ea/b5/37726c750a4f4598660998327c3566b2d2ed5a1a5f44e9f0dde875602447/visualdl-2.5.3-py3-none-any.whl (6.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.3/6.3 MB 7.1 MB/s eta 0:00:00
Collecting rapidfuzz (from paddleocr==2.7.3)
  Downloading https://mirror.baidu.com/pypi/packages/2a/fc/fbed40f9486d2f27a146ba15bb8ec1f1ec4fc8bad7e7910ced812c75dbd8/rapidfuzz-3.9.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.6 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.6/1.6 MB 3.8 MB/s eta 0:00:00
Collecting opencv-python<=4.6.0.66 (from paddleocr==2.7.3)
  Downloading https://mirror.baidu.com/pypi/packages/12/5d/1527327b9f7ea13bef31377f8bf399f03dc5f4f1c9f1fb69bc56b6e24cd4/opencv_python-4.6.0.66-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (39.5 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 39.5/39.5 MB 5.5 MB/s eta 0:00:00
Collecting opencv-contrib-python<=4.6.0.66 (from paddleocr==2.7.3)
  Downloading https://mirror.baidu.com/pypi/packages/13/2d/e8580e089200a8fe84f9befca59ba2d4c92e174dc17dc37a4574ab113db0/opencv_contrib_python-4.6.0.66-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (45.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 45.3/45.3 MB 6.3 MB/s eta 0:00:00
Collecting cython (from paddleocr==2.7.3)
  Downloading https://mirror.baidu.com/pypi/packages/a8/b9/e01e8f09ccb91884eac5ee865edd24e62b36743d2b4bd04191e6d8c53f49/Cython-3.0.10-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.5 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.5/3.5 MB 5.6 MB/s eta 0:00:00
Collecting lxml (from paddleocr==2.7.3)
  Downloading https://mirror.baidu.com/pypi/packages/4d/72/f118145d85f02a76d3f31955c044cb913419c57413b11cd44c00359903dc/lxml-5.2.2-cp38-cp38-manylinux_2_28_aarch64.whl (4.8 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.8/4.8 MB 6.8 MB/s eta 0:00:00
Collecting premailer (from paddleocr==2.7.3)
  Downloading https://mirror.baidu.com/pypi/packages/b1/07/4e8d94f94c7d41ca5ddf8a9695ad87b888104e2fd41a35546c1dc9ca74ac/premailer-3.10.0-py2.py3-none-any.whl (19 kB)
Collecting openpyxl (from paddleocr==2.7.3)
  Downloading https://mirror.baidu.com/pypi/packages/30/d0/abcdb0669931be3a98881e6d7851605981693e93a7924061c67d0cd9f292/openpyxl-3.1.4-py2.py3-none-any.whl (251 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 251.4/251.4 kB 1.9 MB/s eta 0:00:00
Collecting attrdict (from paddleocr==2.7.3)
  Downloading https://mirror.baidu.com/pypi/packages/ef/97/28fe7e68bc7adfce67d4339756e85e9fcf3c6fd7f0c0781695352b70472c/attrdict-2.0.1-py2.py3-none-any.whl (9.9 kB)
Requirement already satisfied: Pillow>=10.0.0 in /usr/local/python3.8.2/lib/python3.8/site-packages (from paddleocr==2.7.3) (10.3.0)
Collecting pyyaml (from paddleocr==2.7.3)
  Downloading https://mirror.baidu.com/pypi/packages/e1/a1/27bfac14b90adaaccf8c8289f441e9f76d94795ec1e7a8f134d9f2cb3d0b/PyYAML-6.0.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (723 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 723.8/723.8 kB 4.3 MB/s eta 0:00:00
Collecting python-docx (from paddleocr==2.7.3)
  Downloading https://mirror.baidu.com/pypi/packages/3e/3d/330d9efbdb816d3f60bf2ad92f05e1708e4a1b9abe80461ac3444c83f749/python_docx-1.1.2-py3-none-any.whl (244 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 244.3/244.3 kB 1.3 MB/s eta 0:00:00
Collecting beautifulsoup4 (from paddleocr==2.7.3)
  Downloading https://mirror.baidu.com/pypi/packages/b1/fe/e8c672695b37eecc5cbf43e1d0638d88d66ba3a44c4d321c796f4e59167f/beautifulsoup4-4.12.3-py3-none-any.whl (147 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 147.9/147.9 kB 1.4 MB/s eta 0:00:00
Collecting fonttools>=4.24.0 (from paddleocr==2.7.3)
  Downloading https://mirror.baidu.com/pypi/packages/97/3c/2c9701084d5664c77dc85fdc89a9be49b1457107ab499b9ace08a744f2ae/fonttools-4.53.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.7 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.7/4.7 MB 5.1 MB/s eta 0:00:00
Collecting fire>=0.3.0 (from paddleocr==2.7.3)
  Downloading https://mirror.baidu.com/pypi/packages/1b/1b/84c63f592ecdfbb3d77d22a8d93c9b92791e4fa35677ad71a7d6449100f8/fire-0.6.0.tar.gz (88 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 88.4/88.4 kB 834.9 kB/s eta 0:00:00
  Installing build dependencies ... error
  error: subprocess-exited-with-error
  
  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> [4 lines of output]
      Looking in indexes: https://mirror.baidu.com/pypi/simple/
      WARNING: Skipping page https://mirror.baidu.com/pypi/simple/setuptools/ because the GET request got Content-Type: application/octet-stream. The only supported Content-Types are application/vnd.pypi.simple.v1+json, application/vnd.pypi.simple.v1+html, and text/html
      ERROR: Could not find a version that satisfies the requirement setuptools>=40.8.0 (from versions: none)
      ERROR: No matching distribution found for setuptools>=40.8.0
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

# 报错,找不到setuptools>=40.8.0。老规矩,手工安装
$ pip3 install setuptools-40.8.0-py2.py3-none-any.whl -i https://mirror.baidu.com/pypi/simple/
Looking in indexes: https://mirror.baidu.com/pypi/simple/
Processing ./setuptools-40.8.0-py2.py3-none-any.whl
Installing collected packages: setuptools
  Attempting uninstall: setuptools
    Found existing installation: setuptools 41.2.0
    Uninstalling setuptools-41.2.0:
      Successfully uninstalled setuptools-41.2.0
Successfully installed setuptools-40.8.0

# 继续安装paddleocr
$ pip3 install paddleocr==2.7.3 -i https://mirror.baidu.com/pypi/simple/
# 然后,居然和之前报了一模一样的错。。。仔细看setuptools是安装成功的日志,之前就已经有41.2.0,按理已经满足要求了。放弃百度源,直接从pypi安装。。。
$ pip3 install paddleocr==2.7.3 --timeout=3600
...
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 7.1 MB/s eta 0:00:00
Downloading pyparsing-3.1.2-py3-none-any.whl (103 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 103.2/103.2 kB 2.0 MB/s eta 0:00:00
Downloading python_dateutil-2.9.0.post0-py2.py3-none-any.whl (229 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 229.9/229.9 kB 2.1 MB/s eta 0:00:00
Downloading pytz-2024.1-py2.py3-none-any.whl (505 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 505.5/505.5 kB 2.0 MB/s eta 0:00:00
Downloading tzdata-2024.1-py2.py3-none-any.whl (345 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 345.4/345.4 kB 3.3 MB/s eta 0:00:00
Downloading urllib3-2.2.2-py3-none-any.whl (121 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 121.4/121.4 kB 1.7 MB/s eta 0:00:00
Downloading werkzeug-3.0.3-py3-none-any.whl (227 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 227.3/227.3 kB 3.0 MB/s eta 0:00:00
Downloading more_itertools-10.3.0-py3-none-any.whl (59 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 59.2/59.2 kB 643.0 kB/s eta 0:00:00
Downloading MarkupSafe-2.1.5-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (26 kB)
Downloading zipp-3.19.2-py3-none-any.whl (9.0 kB)
Building wheels for collected packages: fire, PyMuPDFb
  Building wheel for fire (pyproject.toml) ... done
  Created wheel for fire: filename=fire-0.6.0-py2.py3-none-any.whl size=118133 sha256=994ccbb5ea4ccfd4e66d298b86f670229de2a7160fe4fb29aef0b29f89ac8847
  Stored in directory: /root/.cache/pip/wheels/f6/76/a0/afe23f6f3bc186630845efab23bc7a6e348204102070fdf465
  Building wheel for PyMuPDFb (pyproject.toml) ... done
  Created wheel for PyMuPDFb: filename=PyMuPDFb-1.24.6-py3-none-linux_aarch64.whl size=1030 sha256=d67b0517736cc33ba10e3da9fd17a020b2ad187a6cc9bff5e2b83741ab79f7a5
  Stored in directory: /root/.cache/pip/wheels/8c/e2/9e/39ec1e4c2eec9a425032a4116757a2d2bf27ea2f2871da2cad
Successfully built fire PyMuPDFb
Installing collected packages: pytz, PyMuPDFb, pyclipper, lmdb, zipp, urllib3, tzdata, tqdm, tifffile, termcolor, soupsieve, six, shapely, scipy, rarfile, rapidfuzz, pyyaml, PyWavelets, pyparsing, PyMuPDF, pycryptodome, psutil, packaging, opencv-python-headless, opencv-python, opencv-contrib-python, networkx, more-itertools, MarkupSafe, lxml, kiwisolver, itsdangerous, imageio, future, fonttools, et-xmlfile, cython, cycler, cssselect, contourpy, click, charset-normalizer, cachetools, blinker, Babel, Werkzeug, requests, python-docx, python-dateutil, openpyxl, lazy_loader, Jinja2, importlib-resources, importlib-metadata, fire, cssutils, beautifulsoup4, bce-python-sdk, attrdict, scikit-image, premailer, pdf2docx, pandas, matplotlib, flask, imgaug, Flask-Babel, visualdl, paddleocr
Successfully installed Babel-2.15.0 Flask-Babel-4.0.0 Jinja2-3.1.4 MarkupSafe-2.1.5 PyMuPDF-1.24.7 PyMuPDFb-1.24.6 PyWavelets-1.4.1 Werkzeug-3.0.3 attrdict-2.0.1 bce-python-sdk-0.9.17 beautifulsoup4-4.12.3 blinker-1.8.2 cachetools-5.3.3 charset-normalizer-3.3.2 click-8.1.7 contourpy-1.1.1 cssselect-1.2.0 cssutils-2.11.1 cycler-0.12.1 cython-3.0.10 et-xmlfile-1.1.0 fire-0.6.0 flask-3.0.3 fonttools-4.53.0 future-1.0.0 imageio-2.34.2 imgaug-0.4.0 importlib-metadata-8.0.0 importlib-resources-6.4.0 itsdangerous-2.2.0 kiwisolver-1.4.5 lazy_loader-0.4 lmdb-1.4.1 lxml-5.2.2 matplotlib-3.7.5 more-itertools-10.3.0 networkx-3.1 opencv-contrib-python-4.6.0.66 opencv-python-4.6.0.66 opencv-python-headless-4.10.0.84 openpyxl-3.1.4 packaging-24.1 paddleocr-2.7.3 pandas-2.0.3 pdf2docx-0.5.8 premailer-3.10.0 psutil-6.0.0 pyclipper-1.3.0.post5 pycryptodome-3.20.0 pyparsing-3.1.2 python-dateutil-2.9.0.post0 python-docx-1.1.2 pytz-2024.1 pyyaml-6.0.1 rapidfuzz-3.9.3 rarfile-4.2 requests-2.32.3 scikit-image-0.21.0 scipy-1.10.1 shapely-2.0.4 six-1.16.0 soupsieve-2.5 termcolor-2.4.0 tifffile-2023.7.10 tqdm-4.66.4 tzdata-2024.1 urllib3-2.2.2 visualdl-2.5.3 zipp-3.19.2
# 走了proxy才安装成功,不然pypi直连的网速,可能几个小时都装不完。

3.2 验证paddleOCR是否安装成功

  • 查看paddleocr是否安装成功
paddleocr -h

缺少sqlite3

报错,缺少sqlite3模块。这个是python内置的数据库,编译python前,安装的依赖少了。(文档现已补上)

# 安装sqlite开发包
$ yum install sqlite-devel -y
# 进入源码目录
$ cd /home/Python-3.8.2/
# 配置安装目录
 ./configure --enable-optimizations --prefix=/usr/local/python3.8.2
 # 重新编译
 make 
 # 重新安装二制度文件
 make install
 # 验证sqlite3模块是否已安装
 $ python3
 > import slqite3
 > 
# 没有报错了,安装成功
# 重新运行paddleocr
$ paddleocr -h 
-h, --help            show this help message and exit
  --use_gpu USE_GPU
...
# 正常显示帮助,顺利运行了

4. paddleOCR性能测试

4.1 paddleocr测试pdf识别性能

paddleocr --image_dir ./test.pdf --cpu_threads 8 --output rec.txt --use_gpu false --use_angle_cls false
download https://paddleocr.bj.bcebos.com/PP-OCRv4/chinese/ch_PP-OCRv4_det_infer.tar to /root/.paddleocr/whl/det/ch/ch_PP-OCRv4_det_infer/ch_PP-OCRv4_det_infer.tar
100%|███████████████████████████████████████████████████████████████████████████████████| 4.89M/4.89M [00:00<00:00, 16.1MiB/s]
download https://paddleocr.bj.bcebos.com/PP-OCRv4/chinese/ch_PP-OCRv4_rec_infer.tar to /root/.paddleocr/whl/rec/ch/ch_PP-OCRv4_rec_infer/ch_PP-OCRv4_rec_infer.tar
100%|███████████████████████████████████████████████████████████████████████████████████| 11.0M/11.0M [00:00<00:00, 28.4MiB/s]
download https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_cls_infer.tar to /root/.paddleocr/whl/cls/ch_ppocr_mobile_v2.0_cls_infer/ch_ppocr_mobile_v2.0_cls_infer.tar
100%|███████████████████████████████████████████████████████████████████████████████████| 2.19M/2.19M [00:00<00:00, 8.54MiB/s]


--------------------------------------
C++ Traceback (most recent call last):
--------------------------------------
0   inflateReset2

----------------------
Error Message Summary:
----------------------
FatalError: `Segmentation fault` is detected by the operating system.
  [TimeInfo: *** Aborted at 1719492178 (unix time) try "date -d @1719492178" if you are using GNU date ***]
  [SignalInfo: *** SIGSEGV (@0x10) received by PID 95061 (TID 0xffff081e47e0) from PID 16 ***]
# 理所当然,又又又又报错了。而且是一脸懵逼的错。

github上找issue,不能说一模一样吧,简直就是双胞胎
issue

# 切换成2.5.2重新测试
$ pip3 install paddlepaddle-2.5.2-cp38-cp38-manylinux2014_aarch64.whl --timeout=3600
Processing ./paddlepaddle-2.5.2-cp38-cp38-manylinux2014_aarch64.whl
Requirement already satisfied: httpx in /usr/local/python3.8.2/lib/python3.8/site-packages (from paddlepaddle==2.5.2) (0.27.0)
...
Installing collected packages: paddlepaddle
  Attempting uninstall: paddlepaddle
    Found existing installation: paddlepaddle 2.6.1
    Uninstalling paddlepaddle-2.6.1:
      Successfully uninstalled paddlepaddle-2.6.1
Successfully installed paddlepaddle-2.5.2
# 安装成功,再上
$ paddleocr --image_dir ./test.pdf --cpu_threads 8 --output rec.txt --use_gpu false --use_angle_cls false
download https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_cls_infer.tar to /root/.paddleocr/whl/cls/ch_ppocr_mobile_v2.0_cls_infer/ch_ppocr_mobile_v2.0_cls_infer.tar
100%|███████████████████████████████████████████████████████████████████████████████████| 2.19M/2.19M [00:01<00:00, 2.07MiB/s]
[2024/06/27 21:13:10] ppocr DEBUG: Namespace(alpha=1.0, alphacolor=(255, 255, 255), benchmark=False, beta=1.0, binarize=False, ...
[2024/06/27 21:13:10] ppocr INFO: **********./test.pdf**********
Traceback (most recent call last):
  File "/usr/local/python3.8.2/lib/python3.8/site-packages/paddle/utils/lazy_import.py", line 32, in try_import
    mod = importlib.import_module(module_name)
  File "/usr/local/python3.8.2/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/usr/local/python3.8.2/lib/python3.8/site-packages/fitz/__init__.py", line 2, in <module>
    from pymupdf import *
  File "/usr/local/python3.8.2/lib/python3.8/site-packages/pymupdf/__init__.py", line 29, in <module>
    from . import extra
  File "/usr/local/python3.8.2/lib/python3.8/site-packages/pymupdf/extra.py", line 10, in <module>
    from . import _extra
ImportError: libmupdf.so.24.4: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/python3.8.2/bin/paddleocr", line 8, in <module>
    sys.exit(main())
  File "/usr/local/python3.8.2/lib/python3.8/site-packages/paddleocr/paddleocr.py", line 794, in main
    result = engine.ocr(img_path,
  File "/usr/local/python3.8.2/lib/python3.8/site-packages/paddleocr/paddleocr.py", line 647, in ocr
    img = check_img(img)
  File "/usr/local/python3.8.2/lib/python3.8/site-packages/paddleocr/paddleocr.py", line 527, in check_img
    img, flag_gif, flag_pdf = check_and_read(image_file)
  File "/usr/local/python3.8.2/lib/python3.8/site-packages/paddleocr/ppocr/utils/utility.py", line 112, in check_and_read
    fitz = try_import("fitz")
  File "/usr/local/python3.8.2/lib/python3.8/site-packages/paddle/utils/lazy_import.py", line 41, in try_import
    raise ImportError(err_msg)
ImportError: Failed importing fitz. This likely means that some paddle modules require additional dependencies that have to be manually installed (usually with `pip install fitz`). 
# 麻木了,Failed importing fitz,我敢说我见过无数次这个错误,就是fitz和PyMuPDF两个的爱恨情仇,复杂得要命。先不折腾了,明天再看,先用图片测试吧。

4.2 paddleocr测试图片识别性能

4.2.1 300DPI A4大小的png图片(473KB,2478px * 3503px)测试

paddleocr --image_dir ./test-1.png --cpu_threads 8 --output rec.txt --use_gpu false --use_angle_cls false
[2024/06/27 21:20:50] ppocr DEBUG: Namespace(alpha=1.0, alphacolor=(255, 255, 255), benchmark=False, beta=1.0, binarize=False, cls_batch_num=6, ...)
[2024/06/27 21:20:51] ppocr INFO: **********.test-1.png**********
[2024/06/27 21:20:52] ppocr DEBUG: dt_boxes num : 53, elapsed : 1.1459033489227295
[2024/06/27 21:21:07] ppocr DEBUG: rec_res num  : 53, elapsed : 14.777923345565796
...
[2024/06/27 21:21:07] ppocr INFO: [[[878.0, 3251.0], [918.0, 3251.0], [918.0, 3280.0], [878.0, 3280.0]], ('友好', 0.9936521053314209)]
[2024/06/27 21:21:07] ppocr INFO: [[[1416.0, 3284.0], [1545.0, 3284.0], [1545.0, 3324.0], [1416.0, 3324.0]], ('dataset数据集', 0.9795007705688477)]
[2024/06/27 21:21:07] ppocr INFO: [[[1412.0, 3339.0], [1608.0, 3339.0], [1608.0, 3375.0], [1412.0, 3375.0]], ('train/lnfer训练和推理', 0.9572830200195312)]

测试结论:这是一张300DPI的A4大小的图片,在8线程鲲鹏920arm64(没有avx指令) 的cpu上,使用paddleOCR进行推理识别的耗时是16秒。

4.2.2 96DPI A4大小的png图片(95KB,793px * 1121px)测试

paddleocr --image_dir ./test/test-1.png --cpu_threads 8 --output rec.txt --use_gpu false --use_angle_cls false
[2024/06/27 21:50:26] ppocr DEBUG: Namespace(alpha=1.0, alphacolor=(255, 255, 255), benchmark=False, beta=1.0, binarize=False, ...)
[2024/06/27 21:50:27] ppocr INFO: **********./test/test-1.png**********
[2024/06/27 21:50:28] ppocr DEBUG: dt_boxes num : 12, elapsed : 1.122035026550293
[2024/06/27 21:50:36] ppocr DEBUG: rec_res num  : 12, elapsed : 7.64125394821167
...
[2024/06/27 21:50:36] ppocr INFO: [[[38.0, 384.0], [398.0, 385.0], [398.0, 405.0], [38.0, 404.0]], ('总的来说,MindSpore是一个开源的全场景Al框架。', 0.9963896870613098)]
[2024/06/27 21:50:36] ppocr INFO: [[[38.0, 419.0], [431.0, 419.0], [431.0, 439.0], [38.0, 439.0]], ('再来个导图把基本概念先理一理,其中绿底为惊喜元素,', 0.9993771910667419)]
[2024/06/27 21:50:36] ppocr INFO: [[[439.0, 419.0], [558.0, 419.0], [558.0, 439.0], [439.0, 439.0]], ('红底为懵逼元素。', 0.9684547781944275)]
[2024/06/27 21:50:36] ppocr INFO: [[[39.0, 464.0], [176.0, 464.0], [176.0, 488.0], [39.0, 488.0]], ('1.1.1基本概念', 0.9995652437210083)]

测试结论:这是一张96DPI的A4大小的图片,在8线程鲲鹏920arm64(没有avx指令) 的cpu上,使用paddleOCR进行推理识别的耗时是9秒。但是由于图片本身模糊不清,对比300DPI的53个检测框,漏了41个检测框。好吧,这个图片不具有代表性。再测一下批量图片的性能。

4.2.3 96DPI A4大小的png图片单进程批量测试

$ paddleocr --image_dir ./test/ --cpu_threads 8 --output rec.txt --use_gpu false --use_angle_cls false
[2024/06/27 21:56:18] ppocr INFO: **********./test/test-1.png**********
[2024/06/27 21:56:19] ppocr DEBUG: dt_boxes num : 12, elapsed : 1.1205856800079346
[2024/06/27 21:56:27] ppocr DEBUG: rec_res num  : 12, elapsed : 7.5928943157196045
...
[2024/06/27 22:02:08] ppocr INFO: **********./test/test-9.png**********
[2024/06/27 22:02:10] ppocr DEBUG: dt_boxes num : 63, elapsed : 1.1389813423156738
[2024/06/27 22:02:43] ppocr DEBUG: rec_res num  : 63, elapsed : 32.98988652229309
...
[2024/06/27 22:02:43] ppocr INFO: [[[373.0, 1061.0], [719.0, 1061.0], [719.0, 1077.0], [373.0, 1077.0]], ('#创建一个Flatten层,用于将输入展平为一维向量', 0.9904438257217407)]

测试结论:17张96DPI A4大小的png图片单进程批量识别总耗时6分25秒,即505秒,平均每张29秒

4.2.4 96DPI A4大小的png图片8进程批量测试

$ paddleocr --image_dir ./test/ --enable_mkldnn false --cpu_threads 8 --output rec.txt --use_gpu false --use_angle_cls false --use_mp=True --total_process_num 8  --ir_optim true
...
[2024/06/27 22:19:25] ppocr INFO: **********./test/test-1.png**********
[2024/06/27 22:19:26] ppocr DEBUG: dt_boxes num : 12, elapsed : 1.1384954452514648
[2024/06/27 22:19:34] ppocr DEBUG: rec_res num  : 12, elapsed : 7.640575885772705
...
[2024/06/27 22:25:52] ppocr INFO: [[[373.0, 1061.0], [719.0, 1061.0], [719.0, 1077.0], [373.0, 1077.0]], ('#创建一个Flatten层,用于将输入展平为一维向量', 0.9904438257217407)]

测试结论:17张96DPI A4大小的png图片8进程批量识别总耗时6分27秒,和单进程没什么两样。所以这个多进程的设置,到底有什么意义?
另外,由于本次测试的cpu没有avx指令集,无法开启mkldnn加速,整个过程始终只有一个cpu线程在工作。如果有mkldnn加速,把8个cpu线程全跑满,相信不会这样慢的。

4.2.5 300DPI A4大小的png图片8进程批量测试

paddleocr --image_dir ./test2/ --cpu_threads 1 --output rec.txt --use_gpu false --use_angle_cls false --use_mp=True --total_process_num 8 --enable_mkldnn false --ir_optim true
...
[2024/06/27 22:34:30] ppocr INFO: **********./test2/test-1.png**********
[2024/06/27 22:34:31] ppocr DEBUG: dt_boxes num : 53, elapsed : 1.156975507736206
[2024/06/27 22:34:46] ppocr DEBUG: rec_res num  : 53, elapsed : 14.503132581710815
...
[2024/06/27 22:41:21] ppocr INFO: [[[1165.0, 3313.0], [2242.0, 3313.0], [2242.0, 3364.0], [1165.0, 3364.0]], (')#创建一个Flatten层,用于将输入展平为一维向量', 0.9875224828720093)]

测试结论:17张300DPI A4大小的png图片8进程批量识别总耗时6分50秒,和96DPI的差距并不明显。识别过程中应该是有自动缩放的算法,所以其实图片DPI对识别速度的影响几乎可以忽略不计。

5. 总结

  • 鲲鹏920arm64 cpu没有avx指令集,无法启用cpu加速,现在平均识别一页A4纸约30秒。是否启用多进程,对识别性能影响几乎可以忽略不计
  • 目前可以在鲲鹏920arm cpu上正常执行识别的一个组合环境为:
    • 操作系统:uos server V20 1050e
    • python3.8.2(需要内置sqlite模块)
    • pip 20.2.2+
    • paddlepaddle 2.5.2
    • paddleocr 2.7.3
    • 识别pdf,在python3.8以上需要手工处理fitzPyMuPDF的关系,需要安装某个特定版本才可以

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1875526.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

数据结构与算法笔记:高级篇 - 搜索:如何用 A* 搜索算法实现游戏中的寻路功能?

概述 魔兽世界、仙剑奇侠传这类 MMRPG 游戏&#xff0c;不知道你玩过没有&#xff1f;在这些游戏中&#xff0c;有一个非常重要的功能&#xff0c;那就是任务角色自动寻路。当任务处于游戏地图中的某个位置时&#xff0c;我们用鼠标点击另外一个相对较远的位置&#xff0c;任务…

Java学习 - 布隆过滤器

前置需求 需求 已经有50亿个电话号码&#xff0c;现在给出10万个电话号码&#xff0c;如何快速准确地判断这些电话号码是否已经存在&#xff1f; 参考方案 通过数据库查询&#xff1a;比如MySQL&#xff0c;性能不行&#xff0c;速度太慢将数据先放进内存&#xff1a;50亿*8字…

用pycharm进行python爬虫的步骤

使用 pycharm 进行 python 爬虫的步骤&#xff1a;下载并安装 pycharm。创建一个新项目。安装 requests 和 beautifulsoup 库。编写爬虫脚本&#xff0c;包括获取页面内容、解析 html 和提取数据的代码。运行爬虫脚本。保存和处理提取到的数据。 用 PyCharm 进行 Python 爬虫的…

机器人控制系列教程之Simulink中模型搭建(1)

机器人模型获取 接上期&#xff1a;机器人控制系列教程之控制理论概述&#xff0c;文中详细讲解了如何通过Solidworks软件导出URDF格式的文件。文末提到了若需要将其导入到Simulink中可在命令行中输入smimport(urdf/S_Robot_urdf.urdf)&#xff0c;MATLAB将自动打开Simulink以…

TCP单进程循环服务器程序与单进程客户端程序

实验目的 理解并掌握以下内容: 网络进程标识(即套接字地址)在Linux中的数据结构与地址转换函数。网络字节序与主机字节序的定义、转换以及相关函数在网络编程中的应用。数据结构内存对齐的基本规则,以及基于数据结构构建PDU的基本方法。TCP单进程循环服务器与单进程客户端的…

【ai】ubuntu18.04 找不到 nvcc --version问题

nvcc --version显示command not found问题 这个是cuda 库: windows安装了12.5 : 参考大神:解决nvcc --version显示command not found问题 原文链接:https://blog.csdn.net/Flying_sfeng/article/details/103343813 /usr/local/cuda/lib64 与 /usr/local/cuda-11.3/lib64 完…

【机器学习300问】133、什么是降维?有哪些降维的方法?

假如你有一本非常厚的书&#xff0c;每一章代表一个特征维度&#xff0c;而书中的故事&#xff08;数据点&#xff09;在每个章节&#xff08;维度&#xff09;都有详细的描述。但是&#xff0c;读者&#xff08;模型&#xff09;发现很难理解和记忆这个复杂的故事&#xff0c;…

视频监控业务平台LntonCVS国标视频综合管理平台功能及技术优势

随着安防行业的快速进步&#xff0c;传统的视频监控平台正在与先进的技术和互联网技术融合&#xff0c;包括5G通信、GIS、大数据、云计算、边缘计算、AI识别、智能分析和视频直播等。这些技术的整合形成了综合性视频监控管理平台&#xff0c;具备集中管理、多级联网共享、互联互…

在 UBUNTU 22.04 上逐步构建 Postal SMTP 服务器

构建 Postal SMTP 服务器来发送批量电子邮件是电子邮件营销人员的不错选择。Postal 功能非常强大&#xff0c;并拥有大量开发人员的支持。它是一个用 JavaScript 和 Ruby 编写的开源邮件服务器脚本。它可用于构建内部 SMTP 服务器&#xff0c;就像 Mailgun、Sendgrid、Mailchim…

数字信号处理实验四(FIR数字滤波器设计)

FIR数字滤波器设计&#xff08;2学时&#xff09; 要求&#xff1a; 设计一个最小阶次的低通FIR数字滤波器&#xff0c;性能指标为&#xff1a;通带0Hz~1500Hz&#xff0c;阻带截止频率2000Hz&#xff0c;通带波动不大于1%&#xff0c;阻带波动不大于1%&#xff0c;采样频率为8…

JeecgBoot新建模块

引言 jeecg-boot设置了demo, system等默认模块。在二次开发中&#xff0c;常常需要进行模块扩展。比如新增一个订单模块或支付模块。如何准确的新增模块&#xff0c;在此文进行记录。 步骤 新建模块 在项目点击右键&#xff0c;新建模块。 如下图。 注意&#xff1a;报名需…

arco disign vue 日期组件的样式穿透

问题描述: 对日期组件进行样式穿透. 原因分析: 如图,日期组件被展开时它默认将dom元素挂载到body下, 我们的页面在idroot的div 里层, 里层想要穿透外层是万万行不通的. 解决问题: 其实官网提供了参数,但是并没有提供例子, 只能自己摸索着过河. 对于日期组件穿透样式,我们能…

来自Claude官方的提示词库,支持中文!建议收藏!

大家好,我是木易,一个持续关注AI领域的互联网技术产品经理,国内Top2本科,美国Top10 CS研究生,MBA。我坚信AI是普通人变强的“外挂”,所以创建了“AI信息Gap”这个公众号,专注于分享AI全维度知识,包括但不限于AI科普,AI工具测评,AI效率提升,AI行业洞察。关注我,AI之…

KV260视觉AI套件--开箱报告

目录 1. 简介 2. 与 Zynq 的渊源 3. 官方的入门步骤 4. 总结 1. 简介 传统的ARMFPGA或DSPFPGA控制方案在软件、逻辑、硬件以及系统工程的协同调试中&#xff0c;往往需要团队成员之间严格按照预定计划和接口规范进行分工合作&#xff0c;这不仅增加了测试过程的复杂性&…

ubuntu16.04上搭建qt开发环境

安装qt 下载qt在linux下的安装包qt-opensource-linux-x64-5.8.0.run&#xff1b;将安装包拷贝到ubuntu16.04上&#xff1b;执行如下命令进行安装&#xff0c;注意&#xff1a;安装前先断开虚拟机的网络&#xff0c;这样就避免了注册账户的操作 基本上一路按“next”键&#xf…

【2024最新华为OD-C/D卷试题汇总】[支持在线评测] 数字排列游戏(200分) - 三语言AC题解(Python/Java/Cpp)

&#x1f36d; 大家好这里是清隆学长 &#xff0c;一枚热爱算法的程序员 ✨ 本系列打算持续跟新华为OD-C/D卷的三语言AC题解 &#x1f4bb; ACM银牌&#x1f948;| 多次AK大厂笔试 &#xff5c; 编程一对一辅导 &#x1f44f; 感谢大家的订阅➕ 和 喜欢&#x1f497; &#x1f…

第5章 传输层

王道学习 考纲内容 &#xff08;一&#xff09;传输层提供的服务 传输层的功能&#xff1a;传输层寻址与端口&#xff1b;无连接服务和面向连接服务 &#xff08;二&#xff09;UDP UDP数据报&#xff1b;UDP检验 &#xff08;三&#xff09;TCP …

坑——python的redis库的decode_responses设置

python的redis库查询返回的值默认是返回字节串&#xff0c;可以在redis.Redis()方法中通过设置decode_responses参数&#xff0c;让返回值直接是字符串&#xff1b; 查询返回字节串是因为Redis()方法中decode_responses默认值是False&#xff1a; 设置decode_responses为True就…

mac Canon打印机连接教程

官网下载安装驱动&#xff1a; 选择打印机类型和mac系统型号下载即可 Mac PS 打印机驱动程序 双击安装 系统偏好设置 点击“”添加&#xff1a; OK可打印玩耍&#xff01;&#xff01; 备注&#xff1a; 若需扫描&#xff0c;下载扫描程序&#xff1a; 备注&#xff1a;…

java 统计xmind的结点数(测试用例case数)

mac电脑解压出来的xmind的数据主要在content.json上 开头结尾有[],里面是json import org.json.JSONArray; import org.json.JSONObject; import java.io.*; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream;public class XMindLeafCounter2 {public stat…