From 5503d8134a1c75bf6fd73016e9d030b4fbe92ef1 Mon Sep 17 00:00:00 2001 From: terrtia Date: Fri, 26 Apr 2024 10:49:24 +0200 Subject: [PATCH] fix: [ocr] fix ocr supported languages --- bin/modules/OcrExtractor.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bin/modules/OcrExtractor.py b/bin/modules/OcrExtractor.py index ad75a4e4..34c72dbe 100755 --- a/bin/modules/OcrExtractor.py +++ b/bin/modules/OcrExtractor.py @@ -24,7 +24,7 @@ # Default to eng -def get_model_languages(obj, ocr_languages, add_en=True): +def get_model_languages(obj, add_en=True): if add_en: model_languages = {'en'} else: @@ -54,8 +54,6 @@ def get_model_languages(obj, ocr_languages, add_en=True): model_languages.add(lang) return model_languages - model_languages = Ocrs.sanityze_ocr_languages(model_languages, ocr_languages=ocr_languages) - return model_languages # TODO thread @@ -100,7 +98,8 @@ def compute(self, message): if not ocr.exists(): path = image.get_filepath() - languages = get_model_languages(image, self.ocr_languages) + languages = get_model_languages(image) + languages = Ocrs.sanityze_ocr_languages(languages, ocr_languages=self.ocr_languages) print(image.id, languages) texts = Ocrs.extract_text(path, languages) if texts: