用的這個效果不錯
app端:https://github.com/chineseocr/chineseocr
訓練ocr端:https://codeload.github.com/chineseocr/chineseocr/zip/master
環境配置:
conda install pytorch torchvision cpuonly -c pytorch
WINDOWS下安裝CTC FROM WARPCTC_PYTORCH IMPORT CTCLOSS
根據:https://www.freesion.com/article/5487477118/
模型轉換:
pytorch ocr 轉keras ocrpython .\pytorch_to_keras.py -weights_path models/ocr-english.pth -output_path models/ocr-english.h5
遇到的bug:
keras——ValueError: You are trying to load a weight file containing 12 layers into a model with 2 layers.
model=load_model('./model/my_model_weights.h5')
改爲:
model.load_weights('test.h5',by_name=True)