ch_PP-OCRv2_rec.yml 2.0 KB
Newer Older
littletomatodonkey's avatar
littletomatodonkey 已提交
1 2 3 4 5 6
Global:
  debug: false
  use_gpu: true
  epoch_num: 800
  log_smooth_window: 20
  print_batch_step: 10
7
  save_model_dir: ./output/rec_mobile_pp-OCRv2
littletomatodonkey's avatar
littletomatodonkey 已提交
8
  save_epoch_step: 3
9
  eval_batch_step: [0, 2000]
littletomatodonkey's avatar
littletomatodonkey 已提交
10
  cal_metric_during_train: true
littletomatodonkey's avatar
littletomatodonkey 已提交
11 12 13
  pretrained_model:
  checkpoints:
  save_inference_dir:
littletomatodonkey's avatar
littletomatodonkey 已提交
14 15 16 17 18
  use_visualdl: false
  infer_img: doc/imgs_words/ch/word_1.jpg
  character_dict_path: ppocr/utils/ppocr_keys_v1.txt
  max_text_length: 25
  infer_mode: false
19
  use_space_char: true
littletomatodonkey's avatar
littletomatodonkey 已提交
20
  distributed: true
21
  save_res_path: ./output/rec/predicts_mobile_pp-OCRv2.txt
littletomatodonkey's avatar
littletomatodonkey 已提交
22 23 24 25 26 27 28


Optimizer:
  name: Adam
  beta1: 0.9
  beta2: 0.999
  lr:
29 30 31
    name: Piecewise
    decay_epochs : [700, 800]
    values : [0.001, 0.0001]
littletomatodonkey's avatar
littletomatodonkey 已提交
32 33 34
    warmup_epoch: 5
  regularizer:
    name: L2
35 36
    factor: 2.0e-05

37

littletomatodonkey's avatar
littletomatodonkey 已提交
38
Architecture:
39 40 41 42 43 44 45 46 47 48 49 50 51 52
  model_type: rec
  algorithm: CRNN
  Transform:
  Backbone:
    name: MobileNetV1Enhance
    scale: 0.5
  Neck:
    name: SequenceEncoder
    encoder_type: rnn
    hidden_size: 64
  Head:
    name: CTCHead
    mid_channels: 96
    fc_decay: 0.00002
littletomatodonkey's avatar
littletomatodonkey 已提交
53 54

Loss:
55
  name: CTCLoss
littletomatodonkey's avatar
littletomatodonkey 已提交
56 57

PostProcess:
58
  name: CTCLabelDecode
59

littletomatodonkey's avatar
littletomatodonkey 已提交
60
Metric:
61
  name: RecMetric
littletomatodonkey's avatar
littletomatodonkey 已提交
62
  main_indicator: acc
63

littletomatodonkey's avatar
littletomatodonkey 已提交
64 65 66 67 68 69 70 71 72 73
Train:
  dataset:
    name: SimpleDataSet
    data_dir: ./train_data/
    label_file_list:
    - ./train_data/train_list.txt
    transforms:
    - DecodeImage:
        img_mode: BGR
        channel_first: false
littletomatodonkey's avatar
littletomatodonkey 已提交
74 75
    - RecAug:
    - CTCLabelEncode:
littletomatodonkey's avatar
littletomatodonkey 已提交
76
    - RecResizeImg:
77
        image_shape: [3, 32, 320]
littletomatodonkey's avatar
littletomatodonkey 已提交
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
    - KeepKeys:
        keep_keys:
        - image
        - label
        - length
  loader:
    shuffle: true
    batch_size_per_card: 128
    drop_last: true
    num_workers: 8
Eval:
  dataset:
    name: SimpleDataSet
    data_dir: ./train_data
    label_file_list:
    - ./train_data/val_list.txt
    transforms:
    - DecodeImage:
        img_mode: BGR
        channel_first: false
littletomatodonkey's avatar
littletomatodonkey 已提交
98
    - CTCLabelEncode:
littletomatodonkey's avatar
littletomatodonkey 已提交
99
    - RecResizeImg:
100
        image_shape: [3, 32, 320]
littletomatodonkey's avatar
littletomatodonkey 已提交
101 102 103 104 105 106 107 108 109 110
    - KeepKeys:
        keep_keys:
        - image
        - label
        - length
  loader:
    shuffle: false
    drop_last: false
    batch_size_per_card: 128
    num_workers: 8