Modules§
- db_
postprocess - Post-processing for DB (Differentiable Binarization) text detection models.
- formula_
preprocess - Formula preprocessing utilities for formula recognition models.
- layout_
postprocess - Layout Detection Post-processing
- layout_
sorting - Enhanced layout sorting logic —
xycut_enhancedalgorithm. - layout_
utils - Layout parsing utilities.
- resize_
detection - Image resizing utilities for OCR preprocessing
- resize_
recognition - OCR-specific image resizing functionality.
- simd
- SIMD-accelerated kernels for the pipeline’s two hot CPU loops: per-pixel image normalization and per-timestep CTC argmax decode. (Conv/matmul work lives in ONNX Runtime.)
- table_
ocr_ split - Table OCR box splitting utilities.
- table_
structure_ decode - Table Structure Decoding Processor
- types
- Types used in image processing operations
- unimernet_
preprocess - UniMERNet-specific preprocessing functions
- uvdoc_
postprocess - Document transformation post-processing functionality.
Structs§
- Aspect
Ratio Bucket - Aspect ratio bucket definition
- Aspect
Ratio Bucketing - Aspect ratio bucketing processor
- Aspect
Ratio Bucketing Config - Configuration for aspect ratio bucketing
- Base
RecLabel Decode - A base decoder for text recognition that handles character mapping and basic decoding operations.
- Bounding
Box - A bounding box represented by a collection of points.
- CTCLabel
Decode - A decoder for CTC (Connectionist Temporal Classification) based text recognition models.
- Cell
Grid Info - Grid position and span information for a table cell.
- Crop
- A processor for cropping images with different positioning modes.
- Cross
Cell Detection - Detection result for a cross-cell OCR box.
- DBPost
Process - Post-processor for DB (Differentiable Binarization) text detection models.
- DBPost
Process Config - Runtime configuration for DB post-processing.
- DetResize
ForTest - A struct for resizing images for OCR testing
- Formula
Preprocess Params - Configuration parameters for formula preprocessing pipeline.
- Formula
Preprocessor - Formula recognition preprocessor: margin crop → resize-and-pad → normalize-and-grayscale → 4D tensor formatting.
- Image
Scale Info - Information about image scaling during preprocessing
- Layout
Box - Layout box with bounding box and label for sorting/processing purposes.
- LayoutOCR
Association - Result of associating OCR boxes with layout regions.
- Layout
Post Process - Layout detection post-processor for models like PicoDet and RT-DETR.
- MinArea
Rect - A rectangle with minimum area that encloses a shape.
- Normalize
Image - Normalizes images for OCR processing.
- OCRResize
- OCR-specific image resizer.
- Overlap
Removal Result - Result of overlap removal.
- Point
- A 2D point with floating-point coordinates.
- Sortable
Region - Represents a sortable region for hierarchical sorting.
- Split
Config - Configuration for OCR box splitting.
- Split
OcrResult - Result of splitting a single OCR box.
- Split
Segment - A segment resulting from splitting an OCR box.
- Table
Structure Decode - Table structure decoder that converts model outputs to HTML tokens and bboxes.
- Table
Structure Decode Output - Output from table structure decoding.
- Topk
- A processor for extracting top-k results from classification outputs.
- Topk
Result - Result structure for top-k classification processing.
- UVDoc
Post Process - Post-processor for document transformation results.
- UniMER
NetPreprocess Params - Parameters for UniMERNet preprocessing
- UniMER
NetPreprocessor - UniMERNet preprocessor that matches Python’s UniMERNetImgDecode logic
Enums§
- BoxType
- Specifies the type of bounding box used for text detection
- Color
Order - Specifies whether the model expects RGB or BGR channel ordering.
- Crop
Mode - Specifies how to crop an image when the aspect ratios don’t match
- Limit
Type - Specifies how to limit the size of an image during resizing operations
- Resize
Type - Specifies different strategies for resizing images
- Score
Mode - Specifies the mode for calculating scores in text detection/recognition
- Sort
Direction - Direction for XY-cut sorting.
- Tensor
Layout - Specifies the data layout of an image tensor
Functions§
- apply_
nms_ with_ merge - Apply Non-Maximum Suppression with per-class merge modes.
- assign_
elements_ to_ regions - Assigns elements to regions based on overlap threshold.
- associate_
ocr_ with_ layout - Associate OCR results with layout regions.
- calculate_
iou - Calculates the IoU (Intersection over Union) between two bounding boxes.
- calculate_
overlap_ ratio - Calculates the overlap ratio of box a covered by box b. Returns intersection_area / area_a
- create_
expanded_ ocr_ for_ table - Creates expanded OCR results after splitting cross-cell boxes.
- detect_
cross_ cell_ ocr_ boxes - Detects OCR boxes that span multiple table cells.
- get_
overlap_ boxes_ idx - Get indices of OCR boxes that overlap with layout regions.
- get_
overlap_ removal_ indices - Removes overlapping layout blocks, returning only indices to remove.
- merge_
boxes - Merge two bounding boxes according to the specified mode.
- normalize_
latex - Normalizes decoded LaTeX text to match standard output format.
- parse_
cell_ grid_ info - Parses structure tokens to extract grid position and span info for each cell.
- reconcile_
table_ cells - Reconciles structure recognition cells with detected cells.
- remove_
overlap_ blocks - Removes overlapping layout blocks based on overlap ratio threshold.
- reprocess_
table_ cells_ with_ ocr - Reprocesses detected table cell boxes using OCR boxes to better match the structure model’s expected cell count.
- sort_
boxes_ xycut - Sort bounding boxes using XY-cut and return sorted boxes (convenience wrapper).
- sort_
by_ xycut - Sort bounding boxes using the XY-cut algorithm.
- sort_
elements_ with_ regions - Sorts elements within each region using XY-cut, then orders regions.
- sort_
layout_ boxes - Sort layout boxes in reading order with column detection.
- sort_
poly_ boxes - Sort polygon boxes (N-point bounding boxes) in reading order.
- sort_
quad_ boxes - Sort quad boxes (4-point bounding boxes) in reading order.
- sort_
regions - Sorts regions in reading order (top-to-bottom, left-to-right).
- sort_
with_ region_ hierarchy - Convenience function that combines region detection output with layout elements to produce a hierarchically sorted reading order.
- split_
ocr_ box_ at_ cell_ boundaries - Splits an OCR box at cell boundaries and distributes text proportionally.
- split_
text_ by_ ratio - Splits text into parts based on given ratios.
- unclip_
boxes - Apply unclip ratio to expand/shrink bounding boxes while keeping center fixed.
- wrap_
table_ html - Wraps table structure tokens with HTML document tags.
- wrap_
table_ html_ with_ content - Wraps table structure tokens into an HTML string with cell content filled in.
Type Aliases§
- Positioned
Decode Result - Decoded batch outputs along with positional metadata.