You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
667 B

1 month ago
"""
conda activate rag
# 安装docling
pip install docling
# 安装OCR工具
pip install easyocr
"""
import easyocr
ocr_model_path = "E:/model/ocr/EasyOCR/model"
reader = easyocr.Reader(
# 设置识别图片中语言的模型
lang_list=['ch_sim', 'en'],
# 注意会自动下载模型到路径下可以不指定模型目录会自动下载到C盘下
# 包括三个模型
# 文本检测模型CRAFT -- craft_mlt_25k.pth
# 中文简体模型ch_sim -- zh_sim_g2.pth
# 英文模型en -- latin_g2.pth
model_storage_directory=ocr_model_path
)
result = reader.readtext("E:/test/test.png")
print(result)