Skip to content

[proposal] Reduce memory and event-loop cost of the Tesseract fallback preprocessing #1169

Description

@Ishan-Karpe

Hi, I'm Ishan, I'm a high school junior working on Maxun through CodeDay Labs.

I've been reading through DocumentInterpreter.ts and wanted to check something before assuming.

preprocessPageImage() (the Sauvola binarization) seems to only be reachable from
the Tesseract paths. ocrPDF calls it on every rasterized page but paddleOCRPDF
doesn't, and PaddleOCR is the one that runs first, with Tesseract only firing on
a throw. So unless I'm misreading it, the binarization doesn't actually run in
the common case.

Is that on purpose? I could see it being deliberate, since Paddle does its own
normalization and binarizing first might hurt its detection model. If it isn't,
I'd like to look into it, though I'd want to build some kind of OCR quality
benchmark first, since there's no way to measure whether preprocessing helps or
hurts right now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: EvaluatingThis issue is currently being actively evaluated.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions