2021-11-25 16:27:45 +08:00
|
|
|
img_norm_cfg = dict(mean=[127], std=[127])
|
|
|
|
|
|
|
|
train_pipeline = [
|
|
|
|
dict(type='LoadImageFromFile', color_type='grayscale'),
|
|
|
|
dict(
|
|
|
|
type='ResizeOCR',
|
|
|
|
height=32,
|
|
|
|
min_width=100,
|
|
|
|
max_width=100,
|
|
|
|
keep_aspect_ratio=False),
|
|
|
|
dict(type='Normalize', **img_norm_cfg),
|
|
|
|
dict(type='DefaultFormatBundle'),
|
|
|
|
dict(
|
|
|
|
type='Collect',
|
|
|
|
keys=['img'],
|
|
|
|
meta_keys=['filename', 'resize_shape', 'text', 'valid_ratio']),
|
|
|
|
]
|
|
|
|
test_pipeline = [
|
|
|
|
dict(type='LoadImageFromFile', color_type='grayscale'),
|
|
|
|
dict(
|
|
|
|
type='ResizeOCR',
|
|
|
|
height=32,
|
|
|
|
min_width=32,
|
|
|
|
max_width=None,
|
|
|
|
keep_aspect_ratio=True),
|
|
|
|
dict(type='Normalize', **img_norm_cfg),
|
|
|
|
dict(type='DefaultFormatBundle'),
|
|
|
|
dict(
|
|
|
|
type='Collect',
|
|
|
|
keys=['img'],
|
2022-01-26 21:02:31 +08:00
|
|
|
meta_keys=[
|
|
|
|
'filename', 'resize_shape', 'valid_ratio', 'img_norm_cfg',
|
|
|
|
'ori_filename', 'img_shape', 'ori_shape'
|
|
|
|
]),
|
2021-11-25 16:27:45 +08:00
|
|
|
]
|