下载对应的whl:下载安装Linux预测库 根据系统(win和linux),语言(C++,C,Python),语言版本,CUDA版本,Jetson版本,硬件系统(nano,NX,TX,AGX)等等,一定要选对了
升级 pip
如果您到 pip 默认源的网络连接较差,临时使用本镜像站来升级 pip:
python3.7 -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --upgrade pip
python3.7 -m pip install --upgrade pip
换源
python3.7 -m pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
python3.7 -m pip install -U paddlepaddle_gpu-2.3.2-cp37-cp37m-linux_aarch64.whl
>解决警告:
>```
>WARNING: The scripts pip, pip3 and pip3.6 are installed in '/home/agx2/.local/bin' which is not on PATH.
>Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
> ```
>解决方法:
>```
>sudo gedit ~/.bashrc
>export PATH=/home/agx2/.local/bin:$PATH #最后一行添加
>source ~/.bashrc
>```
---
首先 clone PaddleOCR 代码:
git clone https://github.com/PaddlePaddle/PaddleOCR
然后,安装依赖:
cd PaddleOCR
python3.7 -m pip install -r requirements.txt
python -m pip install paddleocr
报错 :
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.
- 1
- 2
- 3
- 4
- 5
- 6
解决:
sudo python3.7 -m pip install opencv-contrib-python- 注释掉requirements.txt中的:
#opencv-contrib-python==4.4.0.46- 继续执行
python3.7 -m pip install -r requirements.txt
从文档模型库中获取PPOCR模型,下面以PP-OCRv3模型为例,介绍在PPOCR模型在jetson上的使用方式:
下载并解压PP-OCRv3模型:
wget https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_det_infer.tarwget https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_rec_infer.tartar xf ch_PP-OCRv3_det_infer.tartar xf ch_PP-OCRv3_rec_infer.tar执行文本检测预测:
cd PaddleOCRpython3.7 tools/infer/predict_det.py --det_model_dir=./ch_PP-OCRv3_det_infer --image_dir=./doc/imgs/french_0.jpg --use_gpu=True报错:
OSError: Could not find lib geos_c or load any of its variants ['libgeos_c.so.1', 'libgeos_c.so'].
解决:
sudo apt-get install libgeos-dev
再次执行
python3.7 tools/infer/predict_det.py --det_model_dir=./ch_PP-OCRv3_det_infer --image_dir=./doc/imgs/french_0.jpg --use_gpu=True
结果在./inference_results中
conda环境的设置没有太大的变化,
pip install rospkg catkin_tools#! /usr/bin/env python3.7改为#! /home/gsh/anaconda3/envs/pplabel/bin/pythonconda install geopandas