Skip to content

Commit 784ccb1

Browse files
artizclaude
andcommitted
#157 stage 3 (phase 2): expose resample + tf_match under ocr-prep
Both modules are already pure Rust (resample uses only `image`; tf_match only std) but were gated behind `ml`. Re-gate them to ocr-prep and make tf_match a public module so the browser TableFormer path (phase 3) can crop table regions (page→1024px box-average, crop→448 bilinear) and run docling's cell matcher — the same code the native pipeline uses. Native `ml` still pulls them in (ocr-prep ⊂ ml); the ocr-prep-only slice now compiles both. No behavior change. Refs #157 Signed-off-by: artiz <artem.kustikov@gmail.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EY5KAiquN4YpVf2PXEQkVT
1 parent 664622e commit 784ccb1

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

crates/docling-pdf/src/lib.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ mod ocr;
3131
pub mod ocr_prep;
3232
pub mod pdfium_backend;
3333
mod reading_order;
34-
#[cfg(feature = "ml")]
34+
// Pure-Rust region resampling (page→1024px box-average, crop→448 bilinear) —
35+
// available to the browser TableFormer path (#157 stage 3), not just `ml`.
36+
#[cfg(feature = "ocr-prep")]
3537
pub mod resample;
3638
#[cfg(feature = "ocr-prep")]
3739
pub mod scanned;
@@ -40,8 +42,10 @@ pub mod tableformer;
4042
#[cfg(feature = "ocr-prep")]
4143
pub mod tf_core;
4244
pub mod textparse;
43-
#[cfg(feature = "ml")]
44-
mod tf_match;
45+
// docling's TableFormer cell matcher — pure Rust, shared with the browser
46+
// TableFormer path (#157 stage 3).
47+
#[cfg(feature = "ocr-prep")]
48+
pub mod tf_match;
4549
pub mod timing;
4650

4751
#[cfg(feature = "ml")]

0 commit comments

Comments
 (0)