16 lines
353 B
Python
16 lines
353 B
Python
|
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]] = []
|