Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Releasing SimdPaddleOCR – a complete OCR inference library in pure C#

Описание и применение

SimdPaddleOCR – полностью управляемая библиотека OCR на C#, без нативных зависимостей, упрощает развертывание и повышает производительность по сравнению с аналогами на C.

Задача

Deploying OCR engines in .NET projects often requires native dependencies (P/Invoke, OpenCV DLLs, CUDA, etc.) that complicate distribution and cause runtime failures on different platforms.

Результат

SimdPaddleOCR delivers end‑to‑end scene OCR inference entirely in managed code, eliminating native DLLs, reducing deployment friction, and achieving faster inference than a comparable pure‑C implementation on the same model.

Рабочий процесс

  • 1. Add NuGet packages: Sdcb.SimdPaddleOCR, Sdcb.SimdPaddleOCR.Models.ChineseV6Tiny, and an image decoder such as SixLabors.ImageSharp.
  • 2. Load the embedded model: await PaddleOcrAll.LoadAsync(ChineseV6TinyModels.Default).
  • 3. Decode an image to a raw 8‑bit BGR byte array using any image library (ImageSharp, SkiaSharp, OpenCvSharp, etc.).
  • 4. Run inference: PaddleOcrResult result = ocr.Run(bgr, width, height).
  • 5. Consume the OCR text from result.Text.
  • 6. (Optional) Use other model packages (Small, Medium, TextLineOrientation) or load custom ONNX files from a local path.

Доказательства

SimdPaddleOCR is a complete OCR inference engine written entirely in C#. It does not depend on Paddle Inference, does not depend on ONNX Runtime, and does not ship OpenCV native DLLs.

Источник

On the same model, the C# version is faster end-to-end than the pure C version (the trade‑off is higher managed memory; native C still wins there).

Источник

Install the core package and the tiny Chinese model in your project (installing tiny automatically pulls in the orientation classification package TextLineOrientation).

Источник

  • Дата записи: 2026-09-13T20:00:55.965Z