e2e_r50_vd_pg.yml 3.4 KB
Newer Older
J
Jethong 已提交
1
Global:
2
  use_gpu: True
J
Jethong 已提交
3 4
  epoch_num: 600
  log_smooth_window: 20
5
  print_batch_step: 10
J
Jethong 已提交
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
J
Jethong 已提交
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:
W
wangjingyeye 已提交
16
  infer_visual_type: EN # two mode: EN is for english datasets, CN is for chinese datasets
J
Jethong 已提交
17
  valid_set: totaltext # two mode: totaltext valid curved words, partvgg valid non-curved words
J
Jethong 已提交
18
  save_res_path: ./output/pgnet_r50_vd_totaltext/predicts_pgnet.txt
J
Jethong 已提交
19
  character_dict_path: ppocr/utils/ic15_dict.txt
J
Jethong 已提交
20
  character_type: EN
J
Jethong 已提交
21 22 23
  max_text_length: 50 # the max length in seq
  max_text_nums: 30 # the max seq nums in a pic
  tcl_len: 64
J
Jethong 已提交
24 25 26

Architecture:
  model_type: e2e
27
  algorithm: PGNet
J
Jethong 已提交
28 29 30 31 32 33 34 35
  Transform:
  Backbone:
    name: ResNet
    layers: 50
  Neck:
    name: PGFPN
  Head:
    name: PGHead
W
wangjingyeye 已提交
36
    character_dict_path: ppocr/utils/ic15_dict.txt # the same as Global:character_dict_path
J
Jethong 已提交
37 38 39

Loss:
  name: PGLoss
J
Jethong 已提交
40 41 42 43
  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
J
Jethong 已提交
44 45

Optimizer:
46 47 48
  name: Adam
  beta1: 0.9
  beta2: 0.999
J
Jethong 已提交
49
  lr:
W
wangjingyeye 已提交
50
    name: Cosine
J
Jethong 已提交
51
    learning_rate: 0.001
W
wangjingyeye 已提交
52
    warmup_epoch: 50
J
Jethong 已提交
53 54
  regularizer:
    name: 'L2'
W
wangjingyeye 已提交
55
    factor: 0.0001
J
Jethong 已提交
56 57 58

PostProcess:
  name: PGPostProcess
J
Jethong 已提交
59
  score_thresh: 0.5
J
Jethong 已提交
60
  mode: fast   # fast or slow two ways
W
wangjingyeye 已提交
61
  point_gather_mode: v3 # same as PGProcessTrain: point_gather_mode
J
Jethong 已提交
62

J
Jethong 已提交
63 64
Metric:
  name: E2EMetric
J
Jethong 已提交
65
  mode: A   # two ways for eval, A: label from txt,  B: label from gt_mat
J
fix yml  
Jethong 已提交
66
  gt_mat_dir:  ./train_data/total_text/gt  # the dir of gt_mat
J
Jethong 已提交
67
  character_dict_path: ppocr/utils/ic15_dict.txt
J
Jethong 已提交
68
  main_indicator: f_score_e2e
J
Jethong 已提交
69 70 71

Train:
  dataset:
J
Jethong 已提交
72
    name: PGDataSet
J
fix yml  
Jethong 已提交
73
    data_dir: ./train_data/total_text/train
J
JetHong 已提交
74
    label_file_list: [./train_data/total_text/train/train.txt]
75
    ratio_list: [1.0]
J
Jethong 已提交
76 77 78 79
    transforms:
      - DecodeImage: # load image
          img_mode: BGR
          channel_first: False
J
Jethong 已提交
80
      - E2ELabelEncodeTrain:
J
Jethong 已提交
81
      - PGProcessTrain:
J
Jethong 已提交
82
          batch_size: 14  # same as loader: batch_size_per_card
W
wangjingyeye 已提交
83 84
          use_resize: True
          use_random_crop: False
J
Jethong 已提交
85 86 87
          min_crop_size: 24
          min_text_size: 4
          max_text_size: 512
W
wangjingyeye 已提交
88
          point_gather_mode: v3 # two ways, v2 is original code, v3 is updated code
J
Jethong 已提交
89 90 91 92 93
      - 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
94 95
    batch_size_per_card: 14
    num_workers: 16
J
Jethong 已提交
96 97 98

Eval:
  dataset:
99
    name: PGDataSet
J
fix yml  
Jethong 已提交
100
    data_dir: ./train_data/total_text/test
J
JetHong 已提交
101
    label_file_list: [./train_data/total_text/test/test.txt]
J
Jethong 已提交
102 103
    transforms:
      - DecodeImage: # load image
L
fix BGR  
LDOUBLEV 已提交
104
          img_mode: BGR
J
Jethong 已提交
105
          channel_first: False
J
Jethong 已提交
106
      - E2ELabelEncodeTest:
J
Jethong 已提交
107 108 109 110 111 112 113 114 115
      - 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:
J
Jethong 已提交
116
          keep_keys: [ 'image', 'shape', 'polys', 'texts', 'ignore_tags', 'img_id']
J
Jethong 已提交
117 118 119 120
  loader:
    shuffle: False
    drop_last: False
    batch_size_per_card: 1 # must be 1
L
fix BGR  
LDOUBLEV 已提交
121
    num_workers: 2