kie_unet_sdmgr.yml 3.08 KB
Newer Older
LDOUBLEV's avatar
add kie  
LDOUBLEV committed
1
2
Global:
  use_gpu: True
LDOUBLEV's avatar
fix yml  
LDOUBLEV committed
3
  epoch_num: 60
LDOUBLEV's avatar
add kie  
LDOUBLEV committed
4
5
6
7
8
9
10
11
12
13
14
15
  log_smooth_window: 20
  print_batch_step: 50
  save_model_dir: ./output/kie_5/
  save_epoch_step: 50
  # evaluation is run every 5000 iterations after the 4000th iteration
  eval_batch_step: [ 0, 80 ]
  # 1. If pretrained_model is saved in static mode, such as classification pretrained model
  #    from static branch, load_static_weights must be set as True.
  # 2. If you want to finetune the pretrained models we provide in the docs,
  #    you should set load_static_weights as False.
  load_static_weights: False
  cal_metric_during_train: False
LDOUBLEV's avatar
fix yml  
LDOUBLEV committed
16
  pretrained_model: 
LDOUBLEV's avatar
add kie  
LDOUBLEV committed
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
  checkpoints:
  save_inference_dir:
  use_visualdl: False
  class_path: ./train_data/wildreceipt/class_list.txt
  infer_img: ./train_data/wildreceipt/1.txt
  save_res_path: ./output/sdmgr_kie/predicts_kie.txt
  img_scale: [ 1024, 512 ]

Architecture:
  model_type: kie
  algorithm: SDMGR
  Transform:
  Backbone:
    name: Kie_backbone
  Head:
    name: SDMGRHead

Loss:
  name: SDMGRLoss

Optimizer:
  name: Adam
  beta1: 0.9
  beta2: 0.999
  lr:
    name: Piecewise
    learning_rate: 0.001
    decay_epochs: [ 60, 80, 100]
    values: [ 0.001, 0.0001, 0.00001]
    warmup_epoch: 2
  regularizer:
    name: 'L2'
    factor: 0.00005

PostProcess:
  name: None

Metric:
  name: KIEMetric
  main_indicator: hmean
57
58
  # Classes that will be ignored while computing F1 score.
  ignore_classes: [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 25]
LDOUBLEV's avatar
add kie  
LDOUBLEV committed
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112

Train:
  dataset:
    name: SimpleDataSet
    data_dir: ./train_data/wildreceipt/
    label_file_list: [ './train_data/wildreceipt/wildreceipt_train.txt' ]
    ratio_list: [ 1.0 ]
    transforms:
      - DecodeImage: # load image
          img_mode: RGB
          channel_first: False
      - NormalizeImage:
          scale: 1
          mean: [ 123.675, 116.28, 103.53 ]
          std: [ 58.395, 57.12, 57.375 ]
          order: 'hwc'
      - KieLabelEncode: # Class handling label
          character_dict_path: ./train_data/wildreceipt/dict.txt
      - KieResize:
      - ToCHWImage:
      - KeepKeys:
          keep_keys: [ 'image', 'relations', 'texts', 'points', 'labels', 'tag', 'shape'] # dataloader will return list in this order
  loader:
    shuffle: True
    drop_last: False
    batch_size_per_card: 4
    num_workers: 4

Eval:
  dataset:
    name: SimpleDataSet
    data_dir: ./train_data/wildreceipt
    label_file_list:
      - ./train_data/wildreceipt/wildreceipt_test.txt
      # - /paddle/data/PaddleOCR/train_data/wildreceipt/1.txt
    transforms:
      - DecodeImage: # load image
          img_mode: RGB
          channel_first: False
      - KieLabelEncode: # Class handling label
          character_dict_path: ./train_data/wildreceipt/dict.txt
      - KieResize:
      - NormalizeImage:
          scale: 1
          mean: [ 123.675, 116.28, 103.53 ]
          std: [ 58.395, 57.12, 57.375 ]
          order: 'hwc'
      - ToCHWImage:
      - KeepKeys:
          keep_keys: [ 'image', 'relations', 'texts', 'points', 'labels', 'tag', 'ori_image', 'ori_boxes', 'shape']
  loader:
    shuffle: False
    drop_last: False
    batch_size_per_card: 1 # must be 1
LDOUBLEV's avatar
fix yml  
LDOUBLEV committed
113
    num_workers: 4