Skip to content

[Bug]paddleocr官网下载的英文模型 使用后识别英文图片出来是中文 #345

Answered by SWHL
sunny-fun asked this question in Q&A
Discussion options

You must be logged in to vote

在上面代码中显式指定一下字典文件呢?类似下面:

current_dir = os.path.dirname(os.path.abspath(__file__))
det_model = os.path.join(current_dir, 'model', 'ch_PP-OCRv4_det_infer') # 这里en_PP-OCRv3_det_infer也测试了也是一样
rec_model = os.path.join(current_dir, 'model', 'en_PP-OCRv4_rec_infer')
self.rapidocr = RapidOCR(
    det_use_cuda=True,
    cls_use_cuda=True, 
    rec_use_cuda=True,
    width_height_ratio=-1,
    min_side_len=640,
    det_model_path=det_model,     # 检测模型路径
    rec_model_path=rec_model      # 识别模型路径
    rec_keys_path='xxxxx.txt'  # 对应字典文件地址
)  

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@sunny-fun
Comment options

@SWHL
Comment options

SWHL Feb 18, 2025
Maintainer

@sunny-fun
Comment options

@SWHL
Comment options

SWHL Feb 19, 2025
Maintainer

Answer selected by sunny-fun
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #344 on February 18, 2025 01:45.