ch_PP-OCRv2_rec.yml 2.1 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 19
  use_visualdl: false
  infer_img: doc/imgs_words/ch/word_1.jpg
  character_dict_path: ppocr/utils/ppocr_keys_v1.txt
  character_type: ch
  max_text_length: 25
  infer_mode: false
20
  use_space_char: true
littletomatodonkey's avatar
littletomatodonkey 已提交
21
  distributed: true
22
  save_res_path: ./output/rec/predicts_mobile_pp-OCRv2.txt
littletomatodonkey's avatar
littletomatodonkey 已提交
23 24 25 26 27 28 29


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

38

littletomatodonkey's avatar
littletomatodonkey 已提交
39
Architecture:
40 41 42 43 44 45 46 47 48 49 50 51 52 53
  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 已提交
54 55

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

PostProcess:
59
  name: CTCLabelDecode
60

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

littletomatodonkey's avatar
littletomatodonkey 已提交
65 66 67 68 69 70 71 72 73 74
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 已提交
75 76
    - RecAug:
    - CTCLabelEncode:
littletomatodonkey's avatar
littletomatodonkey 已提交
77
    - RecResizeImg:
78
        image_shape: [3, 32, 320]
littletomatodonkey's avatar
littletomatodonkey 已提交
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
    - 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 已提交
99
    - CTCLabelEncode:
littletomatodonkey's avatar
littletomatodonkey 已提交
100
    - RecResizeImg:
101
        image_shape: [3, 32, 320]
littletomatodonkey's avatar
littletomatodonkey 已提交
102 103 104 105 106 107 108 109 110 111
    - KeepKeys:
        keep_keys:
        - image
        - label
        - length
  loader:
    shuffle: false
    drop_last: false
    batch_size_per_card: 128
    num_workers: 8