Skip to content

Latest commit

 

History

History
28 lines (21 loc) · 1.2 KB

文本识别训练文档.md

File metadata and controls

28 lines (21 loc) · 1.2 KB

文本识别

数据准备

需要一个train_list.txt示例 , 格式:图片绝对路径+\t+label。 具体可参照项目中data/example中例子。 如果训练过程中需要做验证,需要制作相同的数据格式有一个test_list.txt示例

正常训练模型(以rec_CRNN_ori.yaml为例)

  1. 将yaml中base下的restore,finetune置为False,loss下的use_center置为False,修改数据路径还有其他参数。
  2. 运行下面命令
python3 ./tools/rec_train.py --config ./config/rec_CRNN_ori.yaml --log_str log


#### CenterLoss训练模型(以rec_CRNN_ori.yaml为例)
1. 将yaml中base下的restore,finetune置为True,loss下的use_center置为True,将正常训练得到的最优模型文件地址赋给base下的restore_file。
2. 运行下面命令

python3 ./tools/rec_train.py --config ./config/rec_CRNN_ori.yaml --log_str log

#### 测试模型
1. 将训练好的模型赋给yaml中infer下的model_path,图片地址赋给path
2. 运行下面命令

python3 ./tools/rec_infer.py