e2e_r50_vd_pg.yml 2.8 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
  eval_batch_step: [ 0, 1000 ]
10 11 12 13 14
  # 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: True
J
Jethong 已提交
15 16 17 18 19 20
  cal_metric_during_train: False
  pretrained_model:
  checkpoints:
  save_inference_dir:
  use_visualdl: False
  infer_img:
J
Jethong 已提交
21 22 23 24 25
  valid_set: totaltext #two mode: totaltext valid curved words, partvgg valid non-curved words
  save_res_path: ./output/pgnet_r50_vd_totaltext/predicts_pgnet.txt
  character_dict_path: ppocr/utils/pgnet_dict.txt
  character_type: EN
  max_text_length: 50
J
Jethong 已提交
26 27 28

Architecture:
  model_type: e2e
29
  algorithm: PGNet
J
Jethong 已提交
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
  Transform:
  Backbone:
    name: ResNet
    layers: 50
  Neck:
    name: PGFPN
    model_name: large
  Head:
    name: PGHead
    model_name: large

Loss:
  name: PGLoss

Optimizer:
45 46 47
  name: Adam
  beta1: 0.9
  beta2: 0.999
J
Jethong 已提交
48 49 50 51
  lr:
    learning_rate: 0.001
  regularizer:
    name: 'L2'
52 53
    factor: 0

J
Jethong 已提交
54 55 56 57 58 59

PostProcess:
  name: PGPostProcess
  score_thresh: 0.8
Metric:
  name: E2EMetric
J
Jethong 已提交
60
  character_dict_path: ppocr/utils/pgnet_dict.txt
J
Jethong 已提交
61
  main_indicator: f_score_e2e
J
Jethong 已提交
62 63 64

Train:
  dataset:
J
Jethong 已提交
65 66
    name: PGDataSet
    label_file_list: [.././train_data/total_text/train/]
67
    ratio_list: [1.0]
J
Jethong 已提交
68
    data_format: icdar #two data format: icdar/textnet
J
Jethong 已提交
69 70 71 72 73
    transforms:
      - DecodeImage: # load image
          img_mode: BGR
          channel_first: False
      - PGProcessTrain:
J
Jethong 已提交
74
          batch_size: 14  # same as loader: batch_size_per_card
J
Jethong 已提交
75 76 77 78 79 80 81 82
          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
83 84
    batch_size_per_card: 14
    num_workers: 16
J
Jethong 已提交
85 86 87

Eval:
  dataset:
88
    name: PGDataSet
J
Jethong 已提交
89
    data_dir: ./train_data/
90
    label_file_list: [./train_data/total_text/test/]
J
Jethong 已提交
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
    transforms:
      - DecodeImage: # load image
          img_mode: BGR
          channel_first: False
      - E2ELabelEncode:
      - 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:
          keep_keys: [ 'image', 'shape', 'polys', 'strs', 'tags' ]
  loader:
    shuffle: False
    drop_last: False
    batch_size_per_card: 1 # must be 1
    num_workers: 2