From cc532436471eb07cf7dc526d0634ee57ab16c990 Mon Sep 17 00:00:00 2001 From: liuyebo <1515783401@qq.com> Date: Thu, 17 Oct 2024 16:59:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3ocr=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E8=AF=86=E5=88=AB=E5=88=B0=E5=86=85=E5=AE=B9=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E7=9A=84=E7=A9=BA=E6=8C=87=E9=92=88=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- photo_review/auto_photo_review.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/photo_review/auto_photo_review.py b/photo_review/auto_photo_review.py index 3cde772..014ab10 100644 --- a/photo_review/auto_photo_review.py +++ b/photo_review/auto_photo_review.py @@ -141,7 +141,9 @@ def information_extraction(phrec, pk_phhd): if split_result['img'] is None: continue a4_img = image_util.expand_to_a4_size(split_result['img']) - ocr_result += model_util.ocr(a4_img) + tmp_ocr_result = model_util.ocr(a4_img) + if tmp_ocr_result: + ocr_result += tmp_ocr_result tmp_ocr_text = common_util.ocr_result_to_text(ocr_result) tmp_rec_type = model_util.clas_text(tmp_ocr_text) if ocr_text else None