From 45c92eada27fb3f6f3b8471b798101c26d13a63a Mon Sep 17 00:00:00 2001 From: Robert Sachunsky Date: Fri, 12 Jun 2026 14:55:46 +0200 Subject: [PATCH] models w/ multiple inputs yield a tuple for `.input_shape` --- src/eynollah/eynollah_ocr.py | 3 ++- tests/test_model_zoo.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/eynollah/eynollah_ocr.py b/src/eynollah/eynollah_ocr.py index 76e54a7..9ed02d4 100644 --- a/src/eynollah/eynollah_ocr.py +++ b/src/eynollah/eynollah_ocr.py @@ -166,7 +166,8 @@ class Eynollah_ocr(Eynollah): page_tree: ET.ElementTree, page_ns, ) -> EynollahOcrResult: - _, image_height, image_width, _ = self.model_zoo.get('ocr').input_shape + input_shape, _ = self.model_zoo.get('ocr').input_shape + _, image_height, image_width, _ = input_shape total_bb_coordinates = [] cropped_lines_rgb = [] diff --git a/tests/test_model_zoo.py b/tests/test_model_zoo.py index 2902bfe..082f2a7 100644 --- a/tests/test_model_zoo.py +++ b/tests/test_model_zoo.py @@ -23,6 +23,7 @@ def test_cnnrnnocr1( model = model_zoo.get('ocr') assert isinstance(model, Predictor) shape = model.input_shape - assert len(shape) == 4 + assert len(shape) == 2 + assert len(shape[0]) == 4 except ImportError: pass