Files
wehub-resource-sync 925e56bb5f
Unit tests / build (t4_gpu) (push) Has been cancelled
Unit tests / build (ubuntu-latest) (push) Has been cancelled
Unit tests / build (windows-latest) (push) Has been cancelled
Test CLI scripts / build (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:24:56 +08:00

20 lines
569 B
Python

from typing import List, Optional
from pydantic import BaseModel
from surya.common.polygon import PolygonBox
class LayoutBox(PolygonBox):
label: str # canonicalized via LAYOUT_PRED_RELABEL
raw_label: str # original model label, before canonicalization
position: int # reading order index
count: int = 0 # model's token estimate for OCR output (multiple of 50)
class LayoutResult(BaseModel):
bboxes: List[LayoutBox]
image_bbox: List[float]
raw: Optional[str] = None # raw model output, useful for debugging
error: bool = False