fix ut and text_det create_input (#1756)
parent
9fee1920fa
commit
d0f8be63f3
|
@ -31,6 +31,9 @@ def process_model_config(model_cfg: mmengine.Config,
|
|||
mmengine.Config: the model config after processing.
|
||||
"""
|
||||
pipeline = model_cfg.test_dataloader.dataset.pipeline
|
||||
if isinstance(imgs[0], np.ndarray):
|
||||
# set loading pipeline type
|
||||
pipeline[0].type = 'LoadImageFromNDArray'
|
||||
|
||||
for i, transform in enumerate(pipeline):
|
||||
if transform.type == 'PackTextDetInputs':
|
||||
|
|
|
@ -54,6 +54,10 @@ total_epochs = 5
|
|||
img_norm_cfg = dict(mean=[127], std=[127])
|
||||
|
||||
test_pipeline = [
|
||||
dict(
|
||||
type='LoadImageFromFile',
|
||||
color_type='grayscale',
|
||||
file_client_args=dict(backend='disk')),
|
||||
dict(
|
||||
type='RescaleToHeight',
|
||||
height=32,
|
||||
|
|
|
@ -31,6 +31,10 @@ img_norm_cfg = dict(
|
|||
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
|
||||
|
||||
test_pipeline = [
|
||||
dict(
|
||||
type='LoadImageFromFile',
|
||||
file_client_args=dict(backend='disk'),
|
||||
color_type='color_ignore_orientation'),
|
||||
dict(
|
||||
type='PackTextDetInputs',
|
||||
meta_keys=('img_path', 'ori_shape', 'img_shape', 'scale_factor'))
|
||||
|
@ -53,6 +57,10 @@ test_dataloader = dict(
|
|||
pipeline=None)
|
||||
],
|
||||
pipeline=[
|
||||
dict(
|
||||
type='LoadImageFromFile',
|
||||
file_client_args=dict(backend='disk'),
|
||||
color_type='color_ignore_orientation'),
|
||||
dict(type='Resize', scale=(1333, 736), keep_ratio=True),
|
||||
dict(
|
||||
type='mmocr.PackTextDetInputs',
|
||||
|
|
Loading…
Reference in New Issue