Expand description
Layout detection via the RT-DETR (docling-layout-heron) model exported to
ONNX, run with ort. A port of docling-ibm-models’ LayoutPredictor:
resize the page image to 640×640 and rescale to [0,1] (the heron processor
has do_normalize=false), run the model, then RT-DETR
post_process_object_detection (sigmoid → top-k over query×class →
center-to-corners boxes scaled to the page).
Structs§
- Layout
Model - Region
- One detected region, in page points (top-left origin).
Constants§
- LABELS
- The 17 canonical layout classes, indexed by the model’s class id
(
config.jsonid2label).
Functions§
- label_
threshold - Per-label confidence threshold, ported from docling’s
LayoutPostprocessor.CONFIDENCE_THRESHOLDS. The raw predictor keeps every detection above the 0.3 base; the postprocessor then drops a cluster whose score is below its label’s threshold. Applying it here (equivalent, since every per-label threshold is ≥ the 0.3 base) keeps low-confidence pictures / tables / list-items out of the assembly, matching docling.