You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Remove PP-FormulaNet predictor and associated Python/Rust code
- Consolidate formula and table recognition on GLM-OCR
- Update documentation and build configurations
- Remove unused `bench_formulas` binary and related scripts
|`layout.rs`|`LayoutDetector` — direct ONNX inference on PP-DocLayoutV3, `DetectedRegion`|
50
-
|`formula.rs`|`FormulaPredictor` — custom CUDA formula predictor using split encoder/decoder FP16 ONNX models. Persistent IoBinding with pre-allocated GPU buffers + CUDA graphs on decoder + cudarc D2D/H2D memcpy for zero-allocation decoding|
|`text.rs`| Match pdfium characters to layout regions, reconstruct text with word/paragraph detection. Splices inline formula LaTeX (`$...$`) at correct spatial positions, excluding pdfium chars under formula bboxes. Converts PdfChar Y-up coords to image Y-down space. Also provides `try_extract_inline_formula()` for char-based bypass of simple inline formulas. |
@@ -72,7 +72,7 @@ Seal, Chart, SidebarText
72
72
Content routing by kind:
73
73
-**Text-bearing** → `text` field (pdfium char extraction + inline formula splicing)
74
74
-**Table** → `html` field (oar-ocr SLANet-Plus)
75
-
-**DisplayFormula** → `latex` field (custom FormulaPredictor), rendered as `$$...$$`
75
+
-**DisplayFormula** → `latex` field (GLM-OCR), rendered as `$$...$$`
76
76
-**InlineFormula** → char-based bypass if all chars are known LaTeX tokens; otherwise ML OCR. Merged into parent text region as `$...$`; orphans emitted as standalone `$...$` regions
77
77
-**Visual** (Image/Chart/Seal) → `image_path` field (cropped PNG)
78
78
-**Caption** → `text` field + associated with parent via `caption`
@@ -82,7 +82,7 @@ Content routing by kind:
82
82
-**Fast** (default): SLANet-Plus (7 MB) — fast table recognition
Formula recognition uses the custom split encoder/decoder models (~365 MB total). Simple inline formulas (single variables, Greek letters, basic sub/superscripts) are bypassed via char-based extraction from the PDF text layer, avoiding ML inference.
85
+
Formula recognition uses GLM-OCR (~3.3 GB total ONNX models). Simple inline formulas (single variables, Greek letters, basic sub/superscripts) are bypassed via char-based extraction from the PDF text layer, avoiding ML inference.
86
86
87
87
## Inline Formula Char-Based Bypass
88
88
@@ -122,9 +122,8 @@ Formula recognition uses the custom split encoder/decoder models (~365 MB total)
122
122
123
123
## Model Management
124
124
125
-
Layout/table models auto-download from `github.com/GreatV/oar-ocr/releases` on first use.
126
-
Formula models (`encoder_fp16.onnx`, `decoder_fp16_argmax.onnx`) must be pre-exported via
127
-
`py/pp-formulanet/cuda/export.py` and placed in the model cache directory.
125
+
Layout model auto-downloads from `github.com/GreatV/oar-ocr/releases` on first use.
126
+
GLM-OCR models must be pre-exported via `py/glm-ocr/cuda/export.py` and placed in the model cache directory.
0 commit comments