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.
|
|
|
|
"""
|
|
|
|
|
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)
|