PPOCR Common Commands
作者:XD / 发表: 2022年3月17日 09:50 / 更新: 2022年3月17日 09:51 / 编程笔记 / 阅读量:2302
PPOCR is a open-source OCR framework with the PaddlePaddle environment.
Here are common commands.
# Train
python tools/train.py -c configs/rec/config_name.yml
# Train with Multi-GPU
python -m paddle.distributed.launch --gpus='0,1' tools/train.py -c configs/rec/config_name.yml
# Val
python -m paddle.distributed.launch --gpus '0' tools/eval.py -c output/rec/config.yml -o Global.checkpoints=./output/rec/best_accuracy
# Predict
python tools/infer/predict_rec.py --image_dir="./test/" --rec_model_dir="./inference/rec" --rec_image_shape="3, 32, 100" --rec_char_type="ch" --rec_char_dict_path="./ppocr/utils/dictionary.txt"
# Model to Inference
python tools/export_model.py -c output/rec/config.yml -o Global.checkpoints=./output/rec/best_accuracy Global.save_inference_dir=./inference/rec
# To ONNX
paddle2onnx -m /data/dong/ppocr/output/det/ --model_filename inference.pdmodel --params_filename inference.pdiparams -s det.onnx --opset_version 11
Reference:
https://aistudio.baidu.com/aistudio/projectdetail/3223879 https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.4/doc/doc_ch/detection.md https://aistudio.baidu.com/aistudio/projectdetail/739559