frotms / PaddleOCR2Pytorch

PaddleOCR inference in PyTorch. Converted from [PaddleOCR](https://github.com/PaddlePaddle/PaddleOCR)
Apache License 2.0
860 stars 168 forks source link

ppocr-v3中文识别模型预测结果与paddle的不一致 #49

Closed zhiweizhong closed 2 years ago

zhiweizhong commented 2 years ago

请问下对pytorch版本有要求吗?我使用ch_ptocr_v3_rec_infer.pth的识别结果:

python ./tools/infer/predict_rec.py --rec_algorithm SVTR --rec_model_path ./ch_ptocr_v3_rec_infer.pth --rec_image_shape 3,48,320 --image_dir test.jpg

('注室你的以发一夜七发使用4突击步检命中头部海淡了', 0.74806666)

以下是paddleocr的识别结果:

paddleocr --image_dir  test.jpg --det false

('主室你的队友一液七次i使用AKM突击步枪命中头部淘汰了', 0.9387470483779907)

test

frotms commented 2 years ago

@zhiweizhong 感谢关注。torch>=1.2.0即可,推荐>=1.8.0。如果要和PaddleOCR对齐,请使用和PaddleOCR一样的参数即可: python ./tools/infer/predict_rec.py --rec_algorithm SVTR_lcnet --rec_model_path ./ch_ptocr_v3_rec_infer.pth --rec_image_shape 3,48,320 --image_dir test.jpg 或去掉--rec_algorithm参数) python ./tools/infer/predict_rec.py --rec_model_path ./ch_ptocr_v3_rec_infer.pth --rec_image_shape 3,48,320 --image_dir test.jpg

zhiweizhong commented 2 years ago

感谢大佬,结果现在一致了