ocr/response.py

17 lines
382 B
Python
Raw Permalink Normal View History

2024-10-24 16:23:31 +00:00
from pydantic import BaseModel
from typing import List, Optional
class OCRData(BaseModel):
text: str
bbox: List[List[int]] # 这里使用 List[List[int]] 来表示多个坐标点
confidence: float
class OCRResponse(BaseModel):
success: bool
error: Optional[str]
message: Optional[str]
data: Optional[List[OCRData]] = []
2024-10-24 16:30:25 +00:00
full_text: Optional[str]