From 809cc7d43e26897077be50ae2f15bb5604ba7d94 Mon Sep 17 00:00:00 2001 From: arosasg Date: Sat, 1 Nov 2025 10:45:50 -0400 Subject: [PATCH] fix key error in text_word_region when return_word_box is true but no text was recognized --- paddlex/inference/pipelines/ocr/pipeline.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/paddlex/inference/pipelines/ocr/pipeline.py b/paddlex/inference/pipelines/ocr/pipeline.py index 33b54514c..e8ec0d2c2 100644 --- a/paddlex/inference/pipelines/ocr/pipeline.py +++ b/paddlex/inference/pipelines/ocr/pipeline.py @@ -386,6 +386,11 @@ def predict( ) ] + if return_word_box: + for res in results: + res["text_word"] = [] + res["text_word_region"] = [] + indices = list(range(len(doc_preprocessor_images))) indices = [idx for idx in indices if len(dt_polys_list[idx]) > 0]