-
Notifications
You must be signed in to change notification settings - Fork 56
/
abinet_resnet45_en.yaml
119 lines (105 loc) · 3.13 KB
/
abinet_resnet45_en.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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
57
58
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
113
114
115
116
117
118
119
system:
mode: 0 # 0 for graph mode, 1 for pynative mode in MindSpore
distribute: True
amp_level: 'O0'
seed: 42
log_interval: 100
val_while_train: True
refine_batch_size: False
drop_overflow_update: False
common:
character_dict_path: &character_dict_path
num_classes: &num_classes 37
max_text_len: &max_text_len 25
infer_mode: &infer_mode False
use_space_char: &use_space_char False
batch_size: &batch_size 96
model:
type: rec
pretrained : https://download.mindspore.cn/toolkits/mindocr/abinet/abinet_pretrain_en-821ca20b.ckpt
transform: null
backbone:
name: abinet_backbone
pretrained: False
batchsize: *batch_size
head:
name: ABINetHead
batchsize: *batch_size
postprocess:
name: ABINetLabelDecode
metric:
name: RecMetric
main_indicator: acc
character_dict_path: *character_dict_path
ignore_space: True
print_flag: False
filter_ood: False
loss:
name: ABINetLoss
scheduler:
scheduler: step_decay
decay_rate: 0.1
decay_epochs: 6
warmup_epochs: 0
lr: 0.00001
num_epochs : 10
# scheduler:
# scheduler: warmup_cosine_decay
# lr: 0.00001
# decay_epochs: 12
# num_epochs : 15
optimizer:
opt: adam
train:
clip_grad: True
clip_norm: 20.0
ckpt_save_dir: './tmp_rec'
dataset_sink_mode: False
pred_cast_fp32: False
max_call_depth: 1300
dataset:
type: LMDBDataset
dataset_root: path/to/data_lmdb_release/train/ # Optional, if set, dataset_root will be used as a prefix for data_dir
data_dir: ['MJ/MJ_test','MJ/MJ_train','MJ/MJ_valid','ST']
# label_files: # not required when using LMDBDataset
sample_ratio: 1.0
shuffle: True
transform_pipeline:
- ABINetTransforms:
- ABINetRecAug:
# # the order of the dataloader list, matching the network input and the input labels for the loss function, and optional data for debug/visaulize
output_columns: ['image','label','length','label_for_mask'] #'img_path']
filter_max_len: True
max_text_len: 25
filter_zero_text_image: True
check_rec_image: True
loader:
shuffle: True # TODO: tbc
batch_size: *batch_size
drop_remainder: True
max_rowsize: 64
num_workers: 8
eval:
ckpt_load_path: './tmp_rec/best.ckpt'
dataset_sink_mode: False
pred_cast_fp32: False
dataset:
type: LMDBDataset
dataset_root: path/to/data_lmdb_release/ # Root dir of validation/evaluation dataset
data_dir: evaluation/
# label_files: # not required when using LMDBDataset
sample_ratio: 1.0
shuffle: False
transform_pipeline:
- ABINetEvalTransforms:
- ABINetEval:
# the order of the dataloader list, matching the network input and the input labels for the loss function, and optional data for debug/visaulize
output_columns: ['image','label','length'] # TODO return text string padding w/ fixed length, and a scaler to indicate the length
net_input_column_index: [0] # input indices for network forward func in output_columns
label_column_index: [1, 2] # input indices marked as label
loader:
shuffle: False # TODO: tbc
batch_size: *batch_size
drop_remainder: True
max_rowsize: 64
num_workers: 8