关键词:python easyocr图像识别
一、安装torch
安装命令:
pip install torch==1.7.1 -i https://pypi.tuna.tsinghua.edu.cn/simple
安装过程中如果有以下报错,就降低torchvision版本,执行下面命令:
pip install torchvision==0.9.0 -i https://pypi.tuna.tsinghua.edu.cn/simple

二、安装easyocr
安装命令:
pip install easyocr -i https://pypi.tuna.tsinghua.edu.cn/simple
三、下载训练好的模型
下载地址:
链接:https://pan.baidu.com/s/1EwLEdbRTNtn0VVRJNgtvBQ 提取码:k4e6
把下载的.pth文件保存至本地目录,我保存的位置是:D:\EasyOCR\model
四、安装cv2
安装命令:
pip install opencv-python==4.6.0.66 -i https://pypi.tuna.tsinghua.edu.cn/simple
五、测试
import easyocr
reader = easyocr.Reader(['ch_sim','en'], gpu=False, model_storage_directory=r'D:\EasyOCR\model')
result = reader.readtext('1.jpg')
for re in result:
print(re)
首次运行会自动下载模型,下载过程较慢:
