-
Notifications
You must be signed in to change notification settings - Fork 56
/
east_mobilenetv3_icdar15.yaml
136 lines (124 loc) · 3.4 KB
/
east_mobilenetv3_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
system:
mode: 0 # 0 for graph mode, 1 for pynative mode in MindSpore
distribute: True
amp_level: 'O0'
seed: 17
ckpt_save_policy: top_k
ckpt_max_keep: 5
log_interval: 10
val_while_train: True
drop_overflow_update: False
model:
type: det
transform: null
backbone:
name: det_mobilenet_v3
architecture: large
alpha: 0.5
out_stages: [ 5, 8, 14, 20 ]
bottleneck_params:
se_version: SqueezeExciteV2
always_expand: True
pretrained: https://download.mindspore.cn/toolkits/mindcv/mobilenet/mobilenetv3/mobilenet_v3_large_050_no_scale_se_v2_expand-3c4047ac.ckpt
neck:
name: EASTFPN
out_channels: 128
head:
name: EASTHead
postprocess:
name: EASTPostprocess
score_thresh: 0.8
nms_thresh: 0.2
metric:
name: DetMetric
main_indicator: f-score
loss:
name: EASTLoss
scheduler:
scheduler: 'cosine_decay'
lr: 0.001
min_lr: 0.00001
num_epochs: 5000
warmup_epochs: 10
decay_epochs: 4900
optimizer:
opt: AdamW
beta1: 0.9
beta2: 0.999
weight_decay: 1.0e-4
# only used for mixed precision training
loss_scaler:
type: dynamic
loss_scale: 512
scale_factor: 2
scale_window: 1000
train:
ema: True
ckpt_save_dir: './tmp_det'
dataset_sink_mode: 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:
- EASTProcessTrain:
scale: 0.25
length: 512
- RandomColorAdjust:
brightness: 0.1255 # 32.0 / 255
saturation: 0.5
- 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 input labels for the loss function, and optional data for debug/visualize
output_columns: ['image', 'score_map', 'geo_map', 'training_mask']
net_input_column_index: [ 0 ]
label_column_index: [ 1, 2, 3 ]
# output_columns: ['image'] # for debug op performance
# num_columns_to_net: 1 # num inputs for network forward func in output_columns
loader:
shuffle: True
batch_size: 20
drop_remainder: True
num_workers: 8
eval:
ckpt_load_path: 'tmp_det/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
transform_pipeline:
- DecodeImage:
img_mode: RGB
to_float32: False
- DetLabelEncode:
- DetResize:
target_size: [720, 1280]
force_divisable: False
- 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', 'shape_list' ]
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
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