feat: 关闭ocr
This commit is contained in:
parent
bbd7c23fff
commit
5ac5b5c7b1
|
|
@ -8,6 +8,4 @@ pymupdf
|
||||||
python-docx
|
python-docx
|
||||||
scikit-learn
|
scikit-learn
|
||||||
aiofiles
|
aiofiles
|
||||||
paddlepaddle
|
|
||||||
paddleocr
|
|
||||||
pillow
|
pillow
|
||||||
|
|
@ -4,7 +4,6 @@ import fitz # PyMuPDF
|
||||||
import aiofiles
|
import aiofiles
|
||||||
import io
|
import io
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
# from paddleocr import PaddleOCR
|
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
|
|
||||||
# -----------------------------
|
# -----------------------------
|
||||||
|
|
@ -14,7 +13,6 @@ from PIL import Image
|
||||||
# 初始化 OCR(只初始化一次),注意这是 CPU 版本,如果需要 GPU 需要额外配置
|
# 初始化 OCR(只初始化一次),注意这是 CPU 版本,如果需要 GPU 需要额外配置
|
||||||
print("ocr 加载...")
|
print("ocr 加载...")
|
||||||
ocr = {}
|
ocr = {}
|
||||||
# PaddleOCR(use_angle_cls=True, lang="ch", use_gpu=False)
|
|
||||||
print("ocr 加载结束")
|
print("ocr 加载结束")
|
||||||
|
|
||||||
async def _ocr_image_bytes(img_bytes: bytes) -> str:
|
async def _ocr_image_bytes(img_bytes: bytes) -> str:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue