From 4a1d3978ad449d264e2e3c28d10a5ffeb6d3735a Mon Sep 17 00:00:00 2001 From: Zhao Zuohong Date: Sun, 13 Aug 2023 20:05:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BPaddleOCR=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/riic_report_analysis.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/riic_report_analysis.py b/apps/riic_report_analysis.py index 9a4ccce..9132dca 100644 --- a/apps/riic_report_analysis.py +++ b/apps/riic_report_analysis.py @@ -3,6 +3,9 @@ from paddleocr import PaddleOCR import os +ocr = PaddleOCR(use_angle_cls=False, use_gpu=False) + + class RIICReportAnalysis: async def group_message(self, chain: MessageChain): if len(chain) != 1 or len(chain.images) != 1: @@ -11,8 +14,7 @@ class RIICReportAnalysis: img_path = await img_seg.download() print(f"Image saved to {img_path}") - ocr = PaddleOCR(use_angle_cls=False, lang="ch", use_gpu=False) - ocr_text = ocr.ocr(img_path, det=False) + ocr_text = ocr.ocr(img_path, cls=False) print(ocr_text) os.remove(img_path)