pub struct TsrTableInput {
pub page: u32,
pub crop_pdf_pt_bbox: [f32; 4],
pub render_dpi: f32,
pub structure_tokens: Vec<String>,
pub cell_bboxes: Vec<Vec<f32>>,
}Expand description
Input for extract_tables_with_structure_mem: one cropped table region
plus the raw structure-recovery output for it.
The structure tokens and bboxes are typically produced by an external table-structure recognition model (e.g. SLANet on PaddleOCR) running on a rendered crop of the page. pdf-inspector uses the structure to lay out the cells and pulls the cell text from the native PDF — no OCR involved.
Fields§
§page: u320-indexed page number where the crop was taken from.
crop_pdf_pt_bbox: [f32; 4]Crop bbox on the page, [x1, y1, x2, y2] in PDF points with
top-left origin, relative to the visible page box — the frame of
a rendered page image (see extract_text_in_regions_mem).
render_dpi: f32DPI the crop image was rendered at (e.g. 200.0). Used to convert
cell bboxes from image-pixels back to PDF points.
structure_tokens: Vec<String>Raw structure tokens emitted by the TSR model, in document order.
See [tables::structured::parse_structure] for the accepted grammar.
cell_bboxes: Vec<Vec<f32>>One bbox per cell (in document order, parallel to the cell open-tags
in structure_tokens). May be 4-element [x1,y1,x2,y2] or
8-element 4-corner polygon, in crop image-pixel space.
Trait Implementations§
Source§impl Clone for TsrTableInput
impl Clone for TsrTableInput
Auto Trait Implementations§
impl Freeze for TsrTableInput
impl RefUnwindSafe for TsrTableInput
impl Send for TsrTableInput
impl Sync for TsrTableInput
impl Unpin for TsrTableInput
impl UnsafeUnpin for TsrTableInput
impl UnwindSafe for TsrTableInput
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more