fix doc algorithm&recognition en&ch

上级 1e15b1d1
...@@ -54,11 +54,6 @@ PaddleOCR开源的文本识别算法列表: ...@@ -54,11 +54,6 @@ PaddleOCR开源的文本识别算法列表:
|CRNN|MobileNetV3||rec_mv3_none_bilstm_ctc|[敬请期待]()| |CRNN|MobileNetV3||rec_mv3_none_bilstm_ctc|[敬请期待]()|
|STAR-Net|Resnet34_vd||rec_r34_vd_tps_bilstm_ctc|[敬请期待]()| |STAR-Net|Resnet34_vd||rec_r34_vd_tps_bilstm_ctc|[敬请期待]()|
|STAR-Net|MobileNetV3||rec_mv3_tps_bilstm_ctc|[敬请期待]()| |STAR-Net|MobileNetV3||rec_mv3_tps_bilstm_ctc|[敬请期待]()|
|RARE|Resnet34_vd||rec_r34_vd_tps_bilstm_attn|[敬请期待]()|
|RARE|MobileNetV3||rec_mv3_tps_bilstm_attn|[敬请期待]()|
|SRN|Resnet50_vd_fpn||rec_r50fpn_vd_none_srn|[敬请期待]()|
**说明:** SRN模型使用了数据扰动方法对上述提到对两个训练集进行增广,增广后的数据可以在[百度网盘](https://pan.baidu.com/s/1-HSZ-ZVdqBF2HaBZ5pRAKA)上下载,提取码: y3ry。
原始论文使用两阶段训练平均精度为89.74%,PaddleOCR中使用one-stage训练,平均精度为88.33%。两种预训练权重均在[下载链接](https://paddleocr.bj.bcebos.com/SRN/rec_r50fpn_vd_none_srn.tar)中。
PaddleOCR文本识别算法的训练和使用请参考文档教程中[模型训练/评估中的文本识别部分](./recognition.md) PaddleOCR文本识别算法的训练和使用请参考文档教程中[模型训练/评估中的文本识别部分](./recognition.md)
...@@ -166,9 +166,9 @@ tar -xf rec_mv3_none_bilstm_ctc.tar && rm -rf rec_mv3_none_bilstm_ctc.tar ...@@ -166,9 +166,9 @@ tar -xf rec_mv3_none_bilstm_ctc.tar && rm -rf rec_mv3_none_bilstm_ctc.tar
*如果您安装的是cpu版本,请将配置文件中的 `use_gpu` 字段修改为false* *如果您安装的是cpu版本,请将配置文件中的 `use_gpu` 字段修改为false*
``` ```
# GPU训练 支持单卡,多卡训练,通过selected_gpus参数指定卡号 # GPU训练 支持单卡,多卡训练,通过--gpus参数指定卡号
# 训练icdar15英文数据 并将训练日志保存为 tain_rec.log # 训练icdar15英文数据 并将训练日志保存为 tain_rec.log
python3 -m paddle.distributed.launch --selected_gpus '0,1,2,3' tools/train.py -c configs/rec/rec_icdar15_train.yml 2>&1 | tee train_rec.log python3 -m paddle.distributed.launch --gpus '0,1,2,3' tools/train.py -c configs/rec/rec_icdar15_train.yml
``` ```
<a name="数据增强"></a> <a name="数据增强"></a>
- 数据增强 - 数据增强
...@@ -331,9 +331,8 @@ Eval: ...@@ -331,9 +331,8 @@ Eval:
*注意* 评估时必须确保配置文件中 infer_img 字段为空 *注意* 评估时必须确保配置文件中 infer_img 字段为空
``` ```
export CUDA_VISIBLE_DEVICES=0
# GPU 评估, Global.checkpoints 为待测权重 # GPU 评估, Global.checkpoints 为待测权重
python3 tools/eval.py -c configs/rec/rec_icdar15_train.yml -o Global.checkpoints={path/to/weights}/best_accuracy python3 --gpus '0' tools/eval.py -c configs/rec/rec_icdar15_train.yml -o Global.checkpoints={path/to/weights}/best_accuracy
``` ```
<a name="预测"></a> <a name="预测"></a>
......
...@@ -55,12 +55,6 @@ Refer to [DTRB](https://arxiv.org/abs/1904.01906), the training and evaluation r ...@@ -55,12 +55,6 @@ Refer to [DTRB](https://arxiv.org/abs/1904.01906), the training and evaluation r
|CRNN|MobileNetV3||rec_mv3_none_bilstm_ctc|[Coming soon]()| |CRNN|MobileNetV3||rec_mv3_none_bilstm_ctc|[Coming soon]()|
|STAR-Net|Resnet34_vd||rec_r34_vd_tps_bilstm_ctc|[Coming soon]()| |STAR-Net|Resnet34_vd||rec_r34_vd_tps_bilstm_ctc|[Coming soon]()|
|STAR-Net|MobileNetV3||rec_mv3_tps_bilstm_ctc|[Coming soon]()| |STAR-Net|MobileNetV3||rec_mv3_tps_bilstm_ctc|[Coming soon]()|
|RARE|Resnet34_vd||rec_r34_vd_tps_bilstm_attn|[Coming soon]()|
|RARE|MobileNetV3||rec_mv3_tps_bilstm_attn|[Coming soon]()|
|SRN|Resnet50_vd_fpn||rec_r50fpn_vd_none_srn|[Coming soon]()|
**Note:** SRN model uses data expansion method to expand the two training sets mentioned above, and the expanded data can be downloaded from [Baidu Drive](https://pan.baidu.com/s/1-HSZ-ZVdqBF2HaBZ5pRAKA) (download code: y3ry).
The average accuracy of the two-stage training in the original paper is 89.74%, and that of one stage training in paddleocr is 88.33%. Both pre-trained weights can be downloaded [here](https://paddleocr.bj.bcebos.com/SRN/rec_r50fpn_vd_none_srn.tar).
Please refer to the document for training guide and use of PaddleOCR text recognition algorithms [Text recognition model training/evaluation/prediction](./doc/doc_en/recognition_en.md) Please refer to the document for training guide and use of PaddleOCR text recognition algorithms [Text recognition model training/evaluation/prediction](./doc/doc_en/recognition_en.md)
...@@ -158,10 +158,9 @@ tar -xf rec_mv3_none_bilstm_ctc.tar && rm -rf rec_mv3_none_bilstm_ctc.tar ...@@ -158,10 +158,9 @@ tar -xf rec_mv3_none_bilstm_ctc.tar && rm -rf rec_mv3_none_bilstm_ctc.tar
Start training: Start training:
``` ```
# GPU training Support single card and multi-card training, specify the card number through CUDA_VISIBLE_DEVICES # GPU training Support single card and multi-card training, specify the card number through --gpus
export CUDA_VISIBLE_DEVICES=0,1,2,3
# Training icdar15 English data and saving the log as train_rec.log # Training icdar15 English data and saving the log as train_rec.log
python3 tools/train.py -c configs/rec/rec_icdar15_train.yml 2>&1 | tee train_rec.log python3 -m paddle.distributed.launch --gpus '0,1,2,3' tools/train.py -c configs/rec/rec_icdar15_train.yml
``` ```
<a name="Data_Augmentation"></a> <a name="Data_Augmentation"></a>
- Data Augmentation - Data Augmentation
...@@ -199,39 +198,69 @@ If the evaluation set is large, the test will be time-consuming. It is recommend ...@@ -199,39 +198,69 @@ If the evaluation set is large, the test will be time-consuming. It is recommend
| rec_r34_vd_tps_bilstm_ctc.yml | STARNet | Resnet34_vd | tps | BiLSTM | ctc | | rec_r34_vd_tps_bilstm_ctc.yml | STARNet | Resnet34_vd | tps | BiLSTM | ctc |
For training Chinese data, it is recommended to use For training Chinese data, it is recommended to use
训练中文数据,推荐使用[rec_chinese_lite_train_v1.1.yml](../../configs/rec/ch_ppocr_v1.1/rec_chinese_lite_train_v1.1.yml). If you want to try the result of other algorithms on the Chinese data set, please refer to the following instructions to modify the configuration file: [rec_chinese_lite_train_v1.1.yml](../../configs/rec/ch_ppocr_v1.1/rec_chinese_lite_train_v1.1.yml). If you want to try the result of other algorithms on the Chinese data set, please refer to the following instructions to modify the configuration file:
co co
Take `rec_mv3_none_none_ctc.yml` as an example: Take `rec_chinese_lite_train_v1.1.yml` as an example:
``` ```
Global: Global:
... ...
# Modify image_shape to fit long text # Add a custom dictionary, such as modify the dictionary, please point the path to the new dictionary
image_shape: [3, 32, 320] character_dict_path: ppocr/utils/ppocr_keys_v1.txt
...
# Modify character type # Modify character type
character_type: ch character_type: ch
# Add a custom dictionary, such as modify the dictionary, please point the path to the new dictionary
character_dict_path: ./ppocr/utils/ppocr_keys_v1.txt
... ...
# Modify reader type
reader_yml: ./configs/rec/rec_chinese_reader.yml
# Whether to use data augmentation
distort: true
# Whether to recognize spaces # Whether to recognize spaces
use_space_char: true use_space_char: False
...
...
Optimizer: Optimizer:
... ...
# Add learning rate decay strategy # Add learning rate decay strategy
decay: lr:
function: cosine_decay name: Cosine
# Each epoch contains iter number learning_rate: 0.001
step_each_epoch: 20 ...
# Total epoch number
total_epoch: 1000 ...
Train:
dataset:
# Type of dataset,we support LMDBDateSet and SimpleDataSet
name: SimpleDataSet
# Path of dataset
data_dir: ./train_data/
# Path of train list
label_file_list: ["./train_data/train_list.txt"]
transforms:
...
- RecResizeImg:
# Modify image_shape to fit long text
image_shape: [3, 32, 320]
...
loader:
...
# Train batch_size for Single card
batch_size_per_card: 256
...
Eval:
dataset:
# Type of dataset,we support LMDBDateSet and SimpleDataSet
name: SimpleDataSet
# Path of dataset
data_dir: ./train_data
# Path of eval list
label_file_list: ["./train_data/val_list.txt"]
transforms:
...
- RecResizeImg:
# Modify image_shape to fit long text
image_shape: [3, 32, 320]
...
loader:
# Eval batch_size for Single card
batch_size_per_card: 256
...
``` ```
**Note that the configuration file for prediction/evaluation must be consistent with the training.** **Note that the configuration file for prediction/evaluation must be consistent with the training.**
...@@ -257,18 +286,33 @@ Take `rec_french_lite_train` as an example: ...@@ -257,18 +286,33 @@ Take `rec_french_lite_train` as an example:
``` ```
Global: Global:
... ...
# Add a custom dictionary, if you modify the dictionary # Add a custom dictionary, such as modify the dictionary, please point the path to the new dictionary
# please point the path to the new dictionary
character_dict_path: ./ppocr/utils/dict/french_dict.txt character_dict_path: ./ppocr/utils/dict/french_dict.txt
# Add data augmentation during training
distort: true
# Identify spaces
use_space_char: true
...
# Modify reader type
reader_yml: ./configs/rec/multi_languages/rec_french_reader.yml
... ...
# Whether to recognize spaces
use_space_char: False
... ...
Train:
dataset:
# Type of dataset,we support LMDBDateSet and SimpleDataSet
name: SimpleDataSet
# Path of dataset
data_dir: ./train_data/
# Path of train list
label_file_list: ["./train_data/french_train.txt"]
...
Eval:
dataset:
# Type of dataset,we support LMDBDateSet and SimpleDataSet
name: SimpleDataSet
# Path of dataset
data_dir: ./train_data
# Path of eval list
label_file_list: ["./train_data/french_val.txt"]
...
``` ```
<a name="EVALUATION"></a> <a name="EVALUATION"></a>
...@@ -277,9 +321,8 @@ Global: ...@@ -277,9 +321,8 @@ Global:
The evaluation data set can be modified via `configs/rec/rec_icdar15_reader.yml` setting of `label_file_path` in EvalReader. The evaluation data set can be modified via `configs/rec/rec_icdar15_reader.yml` setting of `label_file_path` in EvalReader.
``` ```
export CUDA_VISIBLE_DEVICES=0
# GPU evaluation, Global.checkpoints is the weight to be tested # GPU evaluation, Global.checkpoints is the weight to be tested
python3 tools/eval.py -c configs/rec/rec_icdar15_reader.yml -o Global.checkpoints={path/to/weights}/best_accuracy python3 --gpus '0' tools/eval.py -c configs/rec/rec_icdar15_reader.yml -o Global.checkpoints={path/to/weights}/best_accuracy
``` ```
<a name="PREDICTION"></a> <a name="PREDICTION"></a>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册