first commit
This commit is contained in:
40
backend/app/schemas/image.py
Normal file
40
backend/app/schemas/image.py
Normal file
@@ -0,0 +1,40 @@
|
||||
from datetime import datetime
|
||||
from uuid import UUID
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
from app.models.evidence_image import SourceApp, PageType, OcrStatus
|
||||
|
||||
|
||||
class ImageOut(BaseModel):
|
||||
id: UUID
|
||||
case_id: UUID
|
||||
url: str = ""
|
||||
thumb_url: str = ""
|
||||
source_app: SourceApp
|
||||
page_type: PageType
|
||||
ocr_status: OcrStatus
|
||||
file_hash: str
|
||||
uploaded_at: datetime
|
||||
|
||||
model_config = {"from_attributes": True}
|
||||
|
||||
|
||||
class OcrBlockOut(BaseModel):
|
||||
id: UUID
|
||||
content: str
|
||||
bbox: dict
|
||||
seq_order: int
|
||||
confidence: float
|
||||
|
||||
model_config = {"from_attributes": True}
|
||||
|
||||
|
||||
class ImageDetailOut(ImageOut):
|
||||
ocr_blocks: list[OcrBlockOut] = []
|
||||
|
||||
|
||||
class OcrFieldCorrection(BaseModel):
|
||||
field_name: str
|
||||
old_value: str
|
||||
new_value: str
|
||||
Reference in New Issue
Block a user