mirror of
https://github.com/open-mmlab/mmdeploy.git
synced 2025-01-14 08:09:43 +08:00
fix ut and text_det create_input (#1756)
This commit is contained in:
parent
9fee1920fa
commit
d0f8be63f3
@ -31,6 +31,9 @@ def process_model_config(model_cfg: mmengine.Config,
|
|||||||
mmengine.Config: the model config after processing.
|
mmengine.Config: the model config after processing.
|
||||||
"""
|
"""
|
||||||
pipeline = model_cfg.test_dataloader.dataset.pipeline
|
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):
|
for i, transform in enumerate(pipeline):
|
||||||
if transform.type == 'PackTextDetInputs':
|
if transform.type == 'PackTextDetInputs':
|
||||||
|
@ -54,6 +54,10 @@ total_epochs = 5
|
|||||||
img_norm_cfg = dict(mean=[127], std=[127])
|
img_norm_cfg = dict(mean=[127], std=[127])
|
||||||
|
|
||||||
test_pipeline = [
|
test_pipeline = [
|
||||||
|
dict(
|
||||||
|
type='LoadImageFromFile',
|
||||||
|
color_type='grayscale',
|
||||||
|
file_client_args=dict(backend='disk')),
|
||||||
dict(
|
dict(
|
||||||
type='RescaleToHeight',
|
type='RescaleToHeight',
|
||||||
height=32,
|
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)
|
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
|
||||||
|
|
||||||
test_pipeline = [
|
test_pipeline = [
|
||||||
|
dict(
|
||||||
|
type='LoadImageFromFile',
|
||||||
|
file_client_args=dict(backend='disk'),
|
||||||
|
color_type='color_ignore_orientation'),
|
||||||
dict(
|
dict(
|
||||||
type='PackTextDetInputs',
|
type='PackTextDetInputs',
|
||||||
meta_keys=('img_path', 'ori_shape', 'img_shape', 'scale_factor'))
|
meta_keys=('img_path', 'ori_shape', 'img_shape', 'scale_factor'))
|
||||||
@ -53,6 +57,10 @@ test_dataloader = dict(
|
|||||||
pipeline=None)
|
pipeline=None)
|
||||||
],
|
],
|
||||||
pipeline=[
|
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='Resize', scale=(1333, 736), keep_ratio=True),
|
||||||
dict(
|
dict(
|
||||||
type='mmocr.PackTextDetInputs',
|
type='mmocr.PackTextDetInputs',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user