From 4eb359e8a7ce84685a23f3f199a14d23b54e96a4 Mon Sep 17 00:00:00 2001 From: tink2123 Date: Tue, 12 May 2020 15:21:59 +0800 Subject: [PATCH] add ic15 yml --- configs/rec/rec_chinese_reader.yml | 4 +-- configs/rec/rec_ic15_reader.yml | 13 +++++++++ configs/rec/rec_ic15_train.yml | 42 ++++++++++++++++++++++++++++++ tools/eval.py | 2 +- 4 files changed, 58 insertions(+), 3 deletions(-) create mode 100755 configs/rec/rec_ic15_reader.yml create mode 100755 configs/rec/rec_ic15_train.yml diff --git a/configs/rec/rec_chinese_reader.yml b/configs/rec/rec_chinese_reader.yml index 19561dd2..9b742753 100755 --- a/configs/rec/rec_chinese_reader.yml +++ b/configs/rec/rec_chinese_reader.yml @@ -2,12 +2,12 @@ TrainReader: reader_function: ppocr.data.rec.dataset_traversal,SimpleReader num_workers: 8 img_set_dir: ./train_data - label_file_path: ./train_data/gt_train.txt + label_file_path: ./train_data/train_label.txt EvalReader: reader_function: ppocr.data.rec.dataset_traversal,SimpleReader img_set_dir: ./train_data - label_file_path: ./train_data/gt_test.txt + label_file_path: ./train_data/test_label.txt TestReader: reader_function: ppocr.data.rec.dataset_traversal,SimpleReader diff --git a/configs/rec/rec_ic15_reader.yml b/configs/rec/rec_ic15_reader.yml new file mode 100755 index 00000000..19561dd2 --- /dev/null +++ b/configs/rec/rec_ic15_reader.yml @@ -0,0 +1,13 @@ +TrainReader: + reader_function: ppocr.data.rec.dataset_traversal,SimpleReader + num_workers: 8 + img_set_dir: ./train_data + label_file_path: ./train_data/gt_train.txt + +EvalReader: + reader_function: ppocr.data.rec.dataset_traversal,SimpleReader + img_set_dir: ./train_data + label_file_path: ./train_data/gt_test.txt + +TestReader: + reader_function: ppocr.data.rec.dataset_traversal,SimpleReader diff --git a/configs/rec/rec_ic15_train.yml b/configs/rec/rec_ic15_train.yml new file mode 100755 index 00000000..05105f04 --- /dev/null +++ b/configs/rec/rec_ic15_train.yml @@ -0,0 +1,42 @@ +Global: + algorithm: CRNN + use_gpu: true + epoch_num: 300 + log_smooth_window: 20 + print_batch_step: 10 + save_model_dir: output_ic15 + save_epoch_step: 3 + eval_batch_step: 2000 + train_batch_size_per_card: 256 + test_batch_size_per_card: 256 + image_shape: [3, 32, 100] + max_text_length: 25 + character_type: ch + character_dict_path: ./ppocr/utils/ic15_dict.txt + loss_type: ctc + reader_yml: ./configs/rec/rec_ic15_reader.yml + pretrain_weights: ./pretrain_models/best_accuracy + infer_img: ./infer_img + +Architecture: + function: ppocr.modeling.architectures.rec_model,RecModel + +Backbone: + function: ppocr.modeling.backbones.rec_mobilenet_v3,MobileNetV3 + scale: 0.5 + model_name: small + +Head: + function: ppocr.modeling.heads.rec_ctc_head,CTCPredict + encoder_type: rnn + SeqRNN: + hidden_size: 48 + +Loss: + function: ppocr.modeling.losses.rec_ctc_loss,CTCLoss + +Optimizer: + function: ppocr.optimizer,AdamDecay + base_lr: 0.001 + beta1: 0.9 + beta2: 0.999 diff --git a/tools/eval.py b/tools/eval.py index 3b176648..949f3a34 100755 --- a/tools/eval.py +++ b/tools/eval.py @@ -80,7 +80,7 @@ def main(): metrics = eval_det_run(exe, config, eval_info_dict, "test") else: reader_type = config['Global']['reader_yml'] - if "chinese" in reader_type: + if "benchmark" not in reader_type: eval_reader = reader_main(config=config, mode="eval") eval_info_dict = {'program': eval_program, \ 'reader': eval_reader, \ -- GitLab