fix mmocr create input error when the arg is array (#1721)

This commit is contained in:
AllentDan 2023-02-08 13:47:47 +08:00 committed by GitHub
parent d28020ec34
commit bc1b6440cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,6 +29,9 @@ def process_model_config(model_cfg: mmengine.Config,
Returns:
mmengine.Config: the model config after processing.
"""
if isinstance(imgs[0], np.ndarray):
# set loading pipeline type
model_cfg.test_pipeline[0].type = 'LoadImageFromNDArray'
test_pipeline = model_cfg._cfg_dict.test_pipeline
for i, transform in enumerate(test_pipeline):
if transform.type == 'PackTextRecogInputs':