赞
踩
环境安装:PaddleHub一键OCR中文识别:https://aistudio.baidu.com/aistudio/projectdetail/512888
开源代码:https://github.com/PaddlePaddle/PaddleHub
- cd paddlehub
- python 1.py
新建test:测试图片 新建out:保存图片 新建test.txt 测试图片名列表
1.py:
- import matplotlib.pyplot as plt
- import matplotlib.image as mpimg
- import os
- import paddlehub as hub
- import cv2
-
- save_path='out'
-
- with open('test.txt', 'r') as f:
- test_img_path=[]
- for line in f:
- test_img_path.append(line.strip())
- print(test_img_path)
-
- #path_list = [args['dataset'] + '/' + path for path in os.listdir(args['dataset'])]
- # 加载移动端预训练模型
- ocr = hub.Module(name="chinese_ocr_db_crnn_mobile")
-
- np_images =[cv2.imread(image_path) for image_path in

Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。