e2e_r50_vd_pg.yml 2.97 KB
Newer Older
Jethong's avatar
Jethong committed
1
Global:
2
  use_gpu: True
Jethong's avatar
Jethong committed
3
4
  epoch_num: 600
  log_smooth_window: 20
5
  print_batch_step: 10
Jethong's avatar
Jethong committed
6
  save_model_dir: ./output/pgnet_r50_vd_totaltext/
7
8
  save_epoch_step: 10
  # evaluation is run every 0 iterationss after the 1000th iteration
Jethong's avatar
Jethong committed
9
10
11
12
13
14
15
  eval_batch_step: [ 0, 1000 ]
  cal_metric_during_train: False
  pretrained_model:
  checkpoints:
  save_inference_dir:
  use_visualdl: False
  infer_img:
Jethong's avatar
Jethong committed
16
  valid_set: totaltext # two mode: totaltext valid curved words, partvgg valid non-curved words
Jethong's avatar
Jethong committed
17
  save_res_path: ./output/pgnet_r50_vd_totaltext/predicts_pgnet.txt
Jethong's avatar
Jethong committed
18
  character_dict_path: ppocr/utils/ic15_dict.txt
Jethong's avatar
Jethong committed
19
  character_type: EN
Jethong's avatar
Jethong committed
20
21
22
  max_text_length: 50 # the max length in seq
  max_text_nums: 30 # the max seq nums in a pic
  tcl_len: 64
Jethong's avatar
Jethong committed
23
24
25

Architecture:
  model_type: e2e
26
  algorithm: PGNet
Jethong's avatar
Jethong committed
27
28
29
30
31
32
33
34
35
36
37
  Transform:
  Backbone:
    name: ResNet
    layers: 50
  Neck:
    name: PGFPN
  Head:
    name: PGHead

Loss:
  name: PGLoss
Jethong's avatar
Jethong committed
38
39
40
41
  tcl_bs: 64
  max_text_length: 50 # the same as Global: max_text_length
  max_text_nums: 30 # the same as Global:max_text_nums
  pad_num: 36 # the length of dict for pad
Jethong's avatar
Jethong committed
42
43

Optimizer:
44
45
46
  name: Adam
  beta1: 0.9
  beta2: 0.999
Jethong's avatar
Jethong committed
47
48
49
50
  lr:
    learning_rate: 0.001
  regularizer:
    name: 'L2'
51
52
    factor: 0

Jethong's avatar
Jethong committed
53
54
55

PostProcess:
  name: PGPostProcess
Jethong's avatar
Jethong committed
56
  score_thresh: 0.5
Jethong's avatar
Jethong committed
57
  mode: fast   # fast or slow two ways
Jethong's avatar
Jethong committed
58

Jethong's avatar
Jethong committed
59
60
Metric:
  name: E2EMetric
Jethong's avatar
Jethong committed
61
  mode: A   # two ways for eval, A: label from txt,  B: label from gt_mat
Jethong's avatar
fix yml  
Jethong committed
62
  gt_mat_dir:  ./train_data/total_text/gt  # the dir of gt_mat
Jethong's avatar
Jethong committed
63
  character_dict_path: ppocr/utils/ic15_dict.txt
Jethong's avatar
Jethong committed
64
  main_indicator: f_score_e2e
Jethong's avatar
Jethong committed
65
66
67

Train:
  dataset:
Jethong's avatar
Jethong committed
68
    name: PGDataSet
Jethong's avatar
fix yml  
Jethong committed
69
    data_dir: ./train_data/total_text/train
JetHong's avatar
JetHong committed
70
    label_file_list: [./train_data/total_text/train/train.txt]
71
    ratio_list: [1.0]
Jethong's avatar
Jethong committed
72
73
74
75
    transforms:
      - DecodeImage: # load image
          img_mode: BGR
          channel_first: False
Jethong's avatar
Jethong committed
76
      - E2ELabelEncodeTrain:
Jethong's avatar
Jethong committed
77
      - PGProcessTrain:
Jethong's avatar
Jethong committed
78
          batch_size: 14  # same as loader: batch_size_per_card
Jethong's avatar
Jethong committed
79
80
81
82
83
84
85
86
          min_crop_size: 24
          min_text_size: 4
          max_text_size: 512
      - KeepKeys:
          keep_keys: [ 'images', 'tcl_maps', 'tcl_label_maps', 'border_maps','direction_maps', 'training_masks', 'label_list', 'pos_list', 'pos_mask' ] # dataloader will return list in this order
  loader:
    shuffle: True
    drop_last: True
87
88
    batch_size_per_card: 14
    num_workers: 16
Jethong's avatar
Jethong committed
89
90
91

Eval:
  dataset:
92
    name: PGDataSet
Jethong's avatar
fix yml  
Jethong committed
93
    data_dir: ./train_data/total_text/test
JetHong's avatar
JetHong committed
94
    label_file_list: [./train_data/total_text/test/test.txt]
Jethong's avatar
Jethong committed
95
96
    transforms:
      - DecodeImage: # load image
LDOUBLEV's avatar
fix BGR  
LDOUBLEV committed
97
          img_mode: BGR
Jethong's avatar
Jethong committed
98
          channel_first: False
Jethong's avatar
Jethong committed
99
      - E2ELabelEncodeTest:
Jethong's avatar
Jethong committed
100
101
102
103
104
105
106
107
108
      - E2EResizeForTest:
          max_side_len: 768
      - NormalizeImage:
          scale: 1./255.
          mean: [ 0.485, 0.456, 0.406 ]
          std: [ 0.229, 0.224, 0.225 ]
          order: 'hwc'
      - ToCHWImage:
      - KeepKeys:
Jethong's avatar
Jethong committed
109
          keep_keys: [ 'image', 'shape', 'polys', 'texts', 'ignore_tags', 'img_id']
Jethong's avatar
Jethong committed
110
111
112
113
  loader:
    shuffle: False
    drop_last: False
    batch_size_per_card: 1 # must be 1
LDOUBLEV's avatar
fix BGR  
LDOUBLEV committed
114
    num_workers: 2