feat(vision): add OCR contracts (#355)

* feat(vision): add OCR contracts

* fix(vision): harden OCR contracts

* refactor(vision): use OCR terminology
This commit is contained in:
Abimael Martell
2026-08-16 23:55:51 -07:00
committed by GitHub
parent d9b83993df
commit dd467dd78d
7 changed files with 1934 additions and 270 deletions
+11 -1
View File
@@ -52,6 +52,14 @@ env_logger = "0.11"
# Optional native page rendering for OCR pipelines. PDFium is loaded at
# runtime, so enabling this feature does not link or download a native library.
firecrawl-pdfium = { version = "0.1.0", optional = true }
# Small support crates used only by the opt-in model cache. Model files remain
# external and are never embedded in pdf-inspector artifacts.
dirs = { version = "6.0", optional = true }
fs2 = { version = "0.4", optional = true }
sha2 = { version = "0.11", optional = true }
[target.'cfg(all(windows, not(target_arch = "wasm32")))'.dependencies]
windows-sys = { version = "0.61", features = ["Win32_Storage_FileSystem"], optional = true }
# Browser builds use JavaScript randomness for encrypted PDFs and embed the
# bundled CMaps because there is no filesystem at runtime.
@@ -65,7 +73,9 @@ tempfile = "3.3"
[features]
default = []
python = ["pyo3"]
render-pdfium = ["dep:firecrawl-pdfium"]
vision = []
model-cache = ["vision", "dep:dirs", "dep:fs2", "dep:sha2", "dep:windows-sys"]
render-pdfium = ["vision", "dep:firecrawl-pdfium"]
[[bin]]
name = "pdf2md"