PaddleOCR/configs/det/ch_PP-OCRv3/ch_PP-OCRv3_det_cml.yml

224 lines
4.6 KiB
YAML
Raw Normal View History

2022-04-24 17:38:43 +08:00
Global:
debug: false
use_gpu: true
epoch_num: 500
log_smooth_window: 20
print_batch_step: 10
2022-04-24 19:52:29 +08:00
save_model_dir: ./output/ch_PP-OCR_v3_det/
2022-04-24 17:38:43 +08:00
save_epoch_step: 100
eval_batch_step:
- 0
- 400
cal_metric_during_train: false
pretrained_model: null
checkpoints: null
save_inference_dir: null
use_visualdl: false
infer_img: doc/imgs_en/img_10.jpg
save_res_path: ./checkpoints/det_db/predicts_db.txt
distributed: true
2022-04-24 17:42:23 +08:00
2022-04-24 17:38:43 +08:00
Architecture:
2022-04-27 10:55:21 +08:00
name: DistillationModel
algorithm: Distillation
2022-04-24 17:38:43 +08:00
model_type: det
2022-04-27 10:55:21 +08:00
Models:
Student:
2022-08-29 14:03:05 +08:00
pretrained:
2022-04-27 10:55:21 +08:00
model_type: det
algorithm: DB
Transform: null
Backbone:
name: MobileNetV3
scale: 0.5
model_name: large
disable_se: true
Neck:
2022-04-27 19:57:48 +08:00
name: RSEFPN
2022-04-27 10:55:21 +08:00
out_channels: 96
shortcut: True
Head:
name: DBHead
k: 50
Student2:
2022-08-29 14:03:05 +08:00
pretrained:
2022-04-27 10:55:21 +08:00
model_type: det
algorithm: DB
Transform: null
Backbone:
name: MobileNetV3
scale: 0.5
model_name: large
disable_se: true
Neck:
2022-04-27 19:57:48 +08:00
name: RSEFPN
2022-04-27 10:55:21 +08:00
out_channels: 96
shortcut: True
Head:
name: DBHead
k: 50
Teacher:
freeze_params: true
return_all_feats: false
model_type: det
algorithm: DB
Backbone:
2022-06-27 16:17:49 +08:00
name: ResNet_vd
2022-04-27 10:55:21 +08:00
in_channels: 3
layers: 50
Neck:
2022-04-27 19:57:48 +08:00
name: LKPAN
2022-04-27 10:55:21 +08:00
out_channels: 256
Head:
name: DBHead
kernel_list: [7,2,2]
k: 50
2022-04-24 17:38:43 +08:00
Loss:
name: CombinedLoss
loss_config_list:
- DistillationDilaDBLoss:
weight: 1.0
model_name_pairs:
- ["Student", "Teacher"]
- ["Student2", "Teacher"]
key: maps
balance_loss: true
main_loss_type: DiceLoss
alpha: 5
beta: 10
ohem_ratio: 3
- DistillationDMLLoss:
model_name_pairs:
- ["Student", "Student2"]
maps_name: "thrink_maps"
weight: 1.0
model_name_pairs: ["Student", "Student2"]
key: maps
- DistillationDBLoss:
weight: 1.0
model_name_list: ["Student", "Student2"]
balance_loss: true
main_loss_type: DiceLoss
alpha: 5
beta: 10
ohem_ratio: 3
Optimizer:
name: Adam
beta1: 0.9
beta2: 0.999
lr:
name: Cosine
learning_rate: 0.001
warmup_epoch: 2
regularizer:
name: L2
factor: 5.0e-05
2022-04-27 19:06:24 +08:00
2022-04-24 17:38:43 +08:00
PostProcess:
2022-04-27 19:06:24 +08:00
name: DistillationDBPostProcess
model_name: ["Student"]
key: head_out
2022-04-24 17:38:43 +08:00
thresh: 0.3
box_thresh: 0.6
max_candidates: 1000
unclip_ratio: 1.5
2022-04-27 19:06:24 +08:00
2022-04-24 17:38:43 +08:00
Metric:
2022-04-27 19:06:24 +08:00
name: DistillationMetric
base_metric_name: DetMetric
2022-04-24 17:38:43 +08:00
main_indicator: hmean
2022-04-27 19:06:24 +08:00
key: "Student"
2022-04-24 17:38:43 +08:00
Train:
dataset:
name: SimpleDataSet
2022-04-24 17:42:23 +08:00
data_dir: ./train_data/icdar2015/text_localization/
2022-04-24 17:38:43 +08:00
label_file_list:
2022-04-24 17:42:23 +08:00
- ./train_data/icdar2015/text_localization/train_icdar2015_label.txt
ratio_list: [1.0]
2022-04-24 17:38:43 +08:00
transforms:
- DecodeImage:
img_mode: BGR
channel_first: false
- DetLabelEncode: null
2022-04-24 19:52:29 +08:00
- CopyPaste:
2022-04-24 17:38:43 +08:00
- IaaAugment:
augmenter_args:
- type: Fliplr
args:
p: 0.5
- type: Affine
args:
rotate:
- -10
- 10
- type: Resize
args:
size:
- 0.5
- 3
- EastRandomCropData:
size:
- 960
- 960
max_tries: 50
keep_ratio: true
- MakeBorderMap:
shrink_ratio: 0.4
thresh_min: 0.3
thresh_max: 0.7
- MakeShrinkMap:
shrink_ratio: 0.4
min_text_size: 8
- NormalizeImage:
scale: 1./255.
mean:
- 0.485
- 0.456
- 0.406
std:
- 0.229
- 0.224
- 0.225
order: hwc
- ToCHWImage: null
- KeepKeys:
keep_keys:
- image
- threshold_map
- threshold_mask
- shrink_map
- shrink_mask
loader:
shuffle: true
drop_last: false
batch_size_per_card: 8
num_workers: 4
2022-08-29 14:03:05 +08:00
2022-04-24 17:38:43 +08:00
Eval:
dataset:
name: SimpleDataSet
2022-04-24 17:42:23 +08:00
data_dir: ./train_data/icdar2015/text_localization/
2022-04-24 17:38:43 +08:00
label_file_list:
2022-04-24 17:42:23 +08:00
- ./train_data/icdar2015/text_localization/test_icdar2015_label.txt
2022-04-24 17:38:43 +08:00
transforms:
2022-08-29 14:03:05 +08:00
- DecodeImage: # load image
img_mode: BGR
channel_first: False
- DetLabelEncode: # Class handling label
- DetResizeForTest:
- 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', 'ignore_tags']
2022-04-24 17:38:43 +08:00
loader:
2022-08-29 14:03:05 +08:00
shuffle: False
drop_last: False
batch_size_per_card: 1 # must be 1
num_workers: 2