改进PaddleOCR初始化
This commit is contained in:
parent
efa1b3bd3d
commit
4a1d3978ad
1 changed files with 4 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue