瀏覽代碼

fix: 修改fitz_doc_to_image函数的返回类型注释为Image.Image

zhch158_admin 1 月之前
父節點
當前提交
339e3e3b23
共有 1 個文件被更改,包括 1 次插入2 次删除
  1. 1 2
      zhch/utils/doc_utils.py

+ 1 - 2
zhch/utils/doc_utils.py

@@ -4,7 +4,6 @@ import enum
 from pydantic import BaseModel, Field
 from pydantic import BaseModel, Field
 from PIL import Image
 from PIL import Image
 
 
-
 class SupportedPdfParseMethod(enum.Enum):
 class SupportedPdfParseMethod(enum.Enum):
     OCR = 'ocr'
     OCR = 'ocr'
     TXT = 'txt'
     TXT = 'txt'
@@ -17,7 +16,7 @@ class PageInfo(BaseModel):
     h: float = Field(description='the height of page')
     h: float = Field(description='the height of page')
 
 
 
 
-def fitz_doc_to_image(doc, target_dpi=200, origin_dpi=None) -> dict:
+def fitz_doc_to_image(doc, target_dpi=200, origin_dpi=None) -> Image.Image:
     """Convert fitz.Document to image, Then convert the image to numpy array.
     """Convert fitz.Document to image, Then convert the image to numpy array.
 
 
     Args:
     Args: