rec_vitstr_none_ce.yml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. Global:
  2. use_gpu: True
  3. epoch_num: 20
  4. log_smooth_window: 20
  5. print_batch_step: 10
  6. save_model_dir: ./output/rec/vitstr_none_ce/
  7. save_epoch_step: 1
  8. # evaluation is run every 2000 iterations after the 0th iteration#
  9. eval_batch_step: [0, 2000]
  10. cal_metric_during_train: True
  11. pretrained_model:
  12. checkpoints:
  13. save_inference_dir:
  14. use_visualdl: False
  15. infer_img: doc/imgs_words_en/word_10.png
  16. # for data or label process
  17. character_dict_path: ppocr/utils/EN_symbol_dict.txt
  18. max_text_length: 25
  19. infer_mode: False
  20. use_space_char: False
  21. save_res_path: ./output/rec/predicts_vitstr.txt
  22. Optimizer:
  23. name: Adadelta
  24. epsilon: 1.e-8
  25. rho: 0.95
  26. clip_norm: 5.0
  27. lr:
  28. learning_rate: 1.0
  29. Architecture:
  30. model_type: rec
  31. algorithm: ViTSTR
  32. in_channels: 1
  33. Transform:
  34. Backbone:
  35. name: ViTSTR
  36. scale: tiny
  37. Neck:
  38. name: SequenceEncoder
  39. encoder_type: reshape
  40. Head:
  41. name: CTCHead
  42. Loss:
  43. name: CELoss
  44. with_all: True
  45. ignore_index: &ignore_index 0 # Must be zero or greater than the number of character classes
  46. PostProcess:
  47. name: ViTSTRLabelDecode
  48. Metric:
  49. name: RecMetric
  50. main_indicator: acc
  51. Train:
  52. dataset:
  53. name: LMDBDataSet
  54. data_dir: ./train_data/data_lmdb_release/training/
  55. transforms:
  56. - DecodeImage: # load image
  57. img_mode: BGR
  58. channel_first: False
  59. - ViTSTRLabelEncode: # Class handling label
  60. ignore_index: *ignore_index
  61. - GrayRecResizeImg:
  62. image_shape: [224, 224] # W H
  63. resize_type: PIL # PIL or OpenCV
  64. inter_type: 'Image.BICUBIC'
  65. scale: false
  66. - KeepKeys:
  67. keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order
  68. loader:
  69. shuffle: True
  70. batch_size_per_card: 48
  71. drop_last: True
  72. num_workers: 8
  73. Eval:
  74. dataset:
  75. name: LMDBDataSet
  76. data_dir: ./train_data/data_lmdb_release/evaluation/
  77. transforms:
  78. - DecodeImage: # load image
  79. img_mode: BGR
  80. channel_first: False
  81. - ViTSTRLabelEncode: # Class handling label
  82. ignore_index: *ignore_index
  83. - GrayRecResizeImg:
  84. image_shape: [224, 224] # W H
  85. resize_type: PIL # PIL or OpenCV
  86. inter_type: 'Image.BICUBIC'
  87. scale: false
  88. - KeepKeys:
  89. keep_keys: ['image', 'label', 'length'] # dataloader will return list in this order
  90. loader:
  91. shuffle: False
  92. drop_last: False
  93. batch_size_per_card: 256
  94. num_workers: 2