【环境搭建】jetson 安装 paddleocr

1.下载paddlepaddle安装包
https://paddleinference.paddlepaddle.org.cn/master/user_guides/download_lib.html#python
选择:Jetpack4.4(4.5): nv_jetson-cuda10.2-trt7-all

2.安装

apt-get install libgeos-dev  # shapely 包
git clone https://github.com/PaddlePaddle/PaddleOCR.git
pip3 install -r requirements.txt 
注意,删除opencv-contrib-python==4.4.0.46,编译时间长,而且编译报错
pip3 install shapely==1.5.9

3.测试

# -*- coding: UTF-8 -*-
from paddleocr import PaddleOCR,draw_ocr
# Paddleocr supports Chinese, English, French, German, Korean and Japanese.
# You can set the parameter `lang` as `ch`, `en`, `fr`, `german`, `korean`, `japan`
# to switch the language model in order.
ocr = PaddleOCR(use_angle_cls=True, lang='ch') # need to run only once to download and load model into memory
img_path = './doc/imgs/1.jpg'
result = ocr.ocr(img_path, cls=True)
print("-"*10)
for line in result:
    print(line)

tools/infer/utility.py  #  配置gpu开关

4.PPOCRLabel文本标注

python -m pip install paddlepaddle -i https://mirror.baidu.com/pypi/simple 
pip install PPOCRLabel  # 安装  cpu版本

# PPOCRLabel文字识别标注工具
PPOCRLabel --lang ch  # 启动【普通模式】,用于打【检测+识别】场景的标签
PPOCRLabel --lang ch --kie True  # 启动 【KIE 模式】,用于打【检测+识别+关键字提取】场景的标签


>>> import paddle
>>> paddle.utils.run_check()
...
PaddlePaddle is installed successfully! Let's start deep learning with PaddlePaddle now.

5.训练

1.切分数据
python gen_ocr_train_val_test.py --trainValTestRatio 6:2:2 --datasetRootPath <数据地址>

2.1 训练分割网络
python tools/train.py -c configs/rec/ch_ppocr_v2.0/rec_chinese_common_train_v2.0.yml

2.2 训练分类网络

5.参考
https://blog.csdn.net/weixin_44065323/article/details/118862091

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值