Skip to content

How to properly load my trained model into Python code ? #7377

Answered by tink2123
huanidz asked this question in Q&A
Discussion options

You must be logged in to vote

Currently paddleocr doesn‘t support the svtr algorithm, and the prediction results will be wrong due to different preprocessing methods. You can try adding SVTR support in paddleocr.

  1. add 'SVTR' in SUPPORT_REC_MODEL

    SUPPORT_REC_MODEL = ['CRNN', 'SVTR_LCNet']

  2. rebuild paddleocr

python setup.py bdist_wheel
python -m pip install dist/paddleocr-xxx.whl
  1. predict by your only model
paddleocr --det=False --image_dir='/pathToMyImg' --rec_algorithm=SVTR --rec_model_dir='PathToMyInferenceModel' --rec_image_shape='3,64,256' --rec_char_dict_path='PathToMyDictFile'

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by huanidz
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