fix ut and text_det create_input (#1756)

pull/1792/head
AllentDan 2023-02-20 16:45:20 +08:00 committed by GitHub
parent 9fee1920fa
commit d0f8be63f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 0 deletions

View File

@ -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':

View File

@ -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,

View File

@ -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',