Skip to content

3.0.0 — no split-licensed dependency, anywhere

Choose a tag to compare

@FarhanLodi FarhanLodi released this 27 Aug 03:11
· 6 commits to main since this release

Two dependencies leave, and with them the last packages in the graph that weren't freely licensed for commercial use.

Imaging moves to EasyImageSharp — MIT, no build-time licence key, no commercial tier for consumers to inherit. Every decode, encode, resize, rotate, crop, threshold and composite runs on it, with input format coverage unchanged or wider.

The PP-StructureV3 document-structure engine is now built in. AnalyzeDocumentAsync used to delegate to the third-party PaddleOcrNet package, which carried the old imaging library as its own dependency — so it landed in your output folder even though nothing in EasyOcrSharp called it. The whole pipeline (layout detection, table/formula/seal recognition, reading order, and the DB + SVTR text engine it runs on) now lives in this repository under EasyOcrSharp.Structure.

⚠️ Migration

Breaking in two namespaces only. No method name, parameter, default or result shape changed.

- using SixLabors.ImageSharp;
- using SixLabors.ImageSharp.PixelFormats;
+ using EasyImageSharp;
+ using EasyImageSharp.PixelFormats;

  // only if you call AnalyzeDocumentAsync:
- using PaddleOcrNet.Structure;
+ using EasyOcrSharp.Structure;

StructureResult, StructureBlock and StructureBlockType keep their names, members and behaviour. Everything else the old package exposed was engine internals and is now internal — which also removes a second public OcrResult / RecognitionOptions / ImageTooLargeException from your graph, so those names resolve unambiguously to EasyOcrSharp's own.

StructureBlock.Lines is now IReadOnlyList<EasyOcrSharp.Models.OcrLine> — the same line type the rest of the API returns, rather than a look-alike from another assembly.

Structure models re-download once on first use after upgrading. They're served from the EasyOcrSharp model repository now and cached alongside the OCR models in %LOCALAPPDATA%/EasyOcrSharp/models; the old %LOCALAPPDATA%/PaddleOcrNet directory is no longer read and can be deleted.

Also in this release

  • Faster — AnalyzeDocumentAsync(Image<Rgb24>) no longer re-encodes the page to PNG in memory and decodes it again. That round-trip existed only to bridge two imaging stacks.
  • Seal recognition works. RecognizeSeals = true previously failed on a model that was never published. It's now published and verified.
  • Deskew is faster — scored on ink coordinates instead of rotating the whole page once per candidate angle, and an already-straight page is left untouched rather than resampled.
  • One model cache. PP-LCNet_x1_0_doc_ori.onnx and UVDoc.onnx are used by both the preprocessing and structure paths and were being stored twice. Now once.
  • Air-gapped mirrors: EASYOCRSHARP_STRUCTURE_MODEL_BASE_URL / EASYOCRSHARP_STRUCTURE_CACHE (the old PADDLEOCRNET_* names still work). A mirror of the old repository needs the new file set.
  • New dependency Clipper2, previously pulled in transitively.
  • Added NOTICE, attributing the Apache-2.0 EasyOCR and PaddleOCR weights and the MIT TrOCR weights downloaded at runtime.

Packages

All three ship at 3.0.0 and are built together — the companions reference the core project directly, so EasyOcrSharp.Gpu no longer trails a version behind.

Package
EasyOcrSharp dotnet add package EasyOcrSharp
EasyOcrSharp.Gpu dotnet add package EasyOcrSharp.Gpu
EasyOcrSharp.Cli dotnet tool install -g EasyOcrSharp.Cli

Final dependency graph: Clipper2, Docnet.Core, EasyImageSharp, Microsoft.Extensions.*, Microsoft.ML.OnnxRuntime, ZXing.Net.

Verification

The structure engine move was accepted only once it proved behaviour-neutral. A golden report of AnalyzeDocumentAsync over six fixture pages was captured before the port, and the in-tree engine's output is byte-for-byte identical to a control harness running the original engine's own source — same block counts, types, bounding boxes and reading order.

993 tests pass, including a full run from a cold cache that downloads every model from the model repository and verifies each against a pinned SHA-256, fail-closed.

Recognized text does shift on a handful of degraded, low-confidence regions — that's the imaging change, not the engine move, and it's what the same models produce on either code path.


Full changelog: CHANGELOG.md