sdcb/SimdPaddleOCR

纯 C# PP-OCRv6 推理库:多平台手写 Kernel / GEMM 等算子、超高性能、低内存需求、超高准确率。 自带托管 ONNX 解释器,不依赖 Paddle Inference、ONNX Runtime 或 OpenCV 原生库。

What it solves

SimdPaddleOCR is a high-performance, pure C# inference library for PP-OCRv6. It allows .NET developers to integrate Optical Character Recognition (OCR) into their applications without relying on heavy native dependencies like Paddle Inference, ONNX Runtime, or OpenCV native libraries.

How it works

The library implements a managed ONNX interpreter with hand-written SIMD kernels and GEMM operators to ensure high performance and low memory usage. It supports multiple pixel formats (BGR24, RGB24, BGRA32, RGBA32) and handles the inference process across detection, classification, and recognition stages.

For hardware acceleration, it provides CPU support via AVX/AVX2/AVX-512/VNNI and GPU support via Vulkan and Metal (specifically for .NET 10), all implemented in pure C# without embedding native binaries.

Who it’s for

.NET developers who need a fast, lightweight, and cross-platform OCR solution that is easy to deploy (especially for Native AOT) and avoids the complexities of managing native binary dependencies.

Highlights

  • Pure C# Implementation: No dependency on native libraries like ONNX Runtime or OpenCV.
  • High Performance: Optimized with hand-written SIMD kernels and GPU backends (Vulkan/Metal).
  • Broad Compatibility: Supports .NET 10 and .NET Standard 2.0, making it compatible with .NET Framework 4.8.
  • Flexible Input: Accepts raw pixel memory, allowing it to work with various image libraries like ImageSharp, SkiaSharp, and OpenCvSharp.
  • AOT Friendly: Fully compatible with Native AOT for efficient deployment.
  • Character-Level Precision: Can estimate individual character bounding boxes using CTC alignment.

Related

  • Project
  • Project
  • Dispatch
  • Project
  • Project