NewsCrawler.org

JiaJiaOCR: a pure Java OCR engine that runs on CPU

JiaJiaOCR is a pure Java OCR[1] engine that adds handwritten text recognition, layout detection, and table detection and recognition on top of general text recognition. It needs no JNI[2], no EXE or DLL files and no Python runtime — the engine ships as a single JAR that can be pulled into a Spring project through Maven. The project is not published to the central Maven repository, so it must be built locally with mvn clean package -DskipTests; onnxruntime 1.19.0, opencv 4.9.0-0, pdfbox 3.0.2 (only for PDF recognition) and commons-lang3 3.17.0 are then added as dependencies in pom.xml. Models must be downloaded from the project's GitHub releases and placed under models on the classpath.

The engine is CPU-first: it explicitly recommends running without GPU or CUDA[3], and supports x86_64 and ARM on Windows, Linux and macOS, including Chinese domestic systems such as Kylin and UOS (Xinchuang[4] compatibility). Models are loaded lazily, only when a feature is used, and are embedded in the JAR by default; an external model directory can be set with -Djiajia.model.dir and supports hot updates. A single instance is thread-safe and, after warm-up, can be shared across threads for concurrent batch recognition.

Recognition modes include general text (mixed Chinese, English, digits and symbols, returning text, confidence and 8-point coordinates) and handwriting optimized for Chinese with 92%+ accuracy on a standard dataset, which the author says is far stronger than Tesseract's handwriting ability. There is also text line detection, layout detection of titles, paragraphs, images and tables with coordinates, table detection with confidence, and table recognition that outputs HTML plus structured JSON at row and column level. Multi-page PDFs are converted to images for batch OCR, and long tasks can be interrupted from another thread via CancellationToken. The project has 105 stars on GitHub.

Read the original juejin.cn

Sources

  • CNJuejin ZH

    又找到一个纯Java的OCR项目,识别的格式还挺多

    8 likes531 views0 comments14 saves

Published: First seen: Читать по-русски

Open as a page