forked from mindspore-lab/mindocr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfce_icdar15.yaml
147 lines (136 loc) · 3.7 KB
/
fce_icdar15.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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
system:
mode: 0 # 0 for graph mode, 1 for pynative mode in MindSpore
distribute: False
amp_level: 'O0'
seed: 42
# log_interval: 10
val_while_train: True
drop_overflow_update: False
model:
resume: False
type: det
transform: null
backbone:
name: det_resnet50
pretrained: True
neck:
name: FCEFPN
out_channels: 256
head:
name: FCEHead
fourier_degree: 5
postprocess:
name: FCEPostprocess
box_type: 'quad'
alpha: 1.2
beta: 1.0
scales: [ 8, 16, 32 ]
metric:
name: DetMetric
main_indicator: f-score
loss:
name: FCELoss
fourier_degree: 5
num_sample: 50
scheduler:
scheduler: polynomial_decay
lr: 0.002
min_lr: 0.0000002
num_epochs: 1500
warmup_epochs: 0
optimizer:
opt: momentum
weight_decay: 5.0e-4
momentum: 0.9
filter_bias_and_bn: False
train:
ckpt_save_dir: './tmp_det'
dataset_sink_mode: True
ema: True
dataset:
type: DetDataset
dataset_root: /data/ocr_datasets
data_dir: ic15/det/train/ch4_training_images
label_file: ic15/det/train/det_gt.txt
sample_ratio: 1.0
transform_pipeline:
- DecodeImage:
img_mode: RGB
to_float32: False
- DetLabelEncode:
- DetResize:
target_size: [ 800, 800 ]
keep_ratio: True
padding: True
- RandomScale:
scale_range: [ 0.75,2.5 ]
p: 1.0
- RandomHorizontalFlip:
p: 0.5
- RandomRotate:
degrees: [ -10, 10 ]
expand_canvas: False
p: 1.0
- RandomCropWithBBox:
max_tries: 10
min_crop_ratio: 0.1
crop_size: [ 640, 640 ]
p: 1.0
- ValidatePolygons:
- RandomColorAdjust:
brightness: 0.1255 # 32.0 / 255
saturation: 0.5
- NormalizeImage:
bgr_to_rgb: False
is_hwc: True
mean: imagenet
std: imagenet
- FCENetTargets:
fourier_degree: 5
level_proportion_range: [ [ 0, 0.25 ], [ 0.2, 0.65 ], [ 0.55, 1.0 ] ]
- ToCHWImage:
# the order of the dataloader list, matching the network input and the input labels for the loss function, and optional data for debug/visualize
output_columns: [ 'image', 'p3_maps','p4_maps','p5_maps' ]
# output_columns: ['image'] # for debug op performance
net_input_column_index: [ 0 ] # input indices for network forward func in output_columns
label_column_index: [ 1, 2, 3 ] # input indices marked as label
loader:
shuffle: True
batch_size: 8
drop_remainder: True
num_workers: 8
eval:
ckpt_load_path: './best.ckpt'
dataset_sink_mode: False
dataset:
type: DetDataset
dataset_root: /data/ocr_datasets
data_dir: ic15/det/test/ch4_test_images
label_file: ic15/det/test/det_gt.txt
sample_ratio: 1.0
shuffle: False
transform_pipeline:
- DecodeImage:
img_mode: RGB
to_float32: False
- DetLabelEncode:
- DetResize:
target_size: [ 800, 800 ]
keep_ratio: True
padding: True
- NormalizeImage:
bgr_to_rgb: False
is_hwc: True
mean: imagenet
std: imagenet
- ToCHWImage:
# the order of the dataloader list, matching the network input and the labels for evaluation
output_columns: [ 'image', 'polys', 'ignore_tags','img_path','texts', 'shape_list' ]
net_input_column_index: [ 0 ] # input indices for network forward func in output_columns
label_column_index: [ 1, 2,3,4 ] # input indices marked as label
# num_keys_of_labels: 2 # num labels
loader:
shuffle: False
batch_size: 1 # TODO: due to dynamic shape of polygons (num of boxes varies), BS has to be 1
drop_remainder: False
num_workers: 1