sdcb/SimdPaddleOCR

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

What it solves

SimdPaddleOCR provides a high-performance, pure C# implementation for running PP-OCRv6 inference. It eliminates the need for heavy native dependencies like Paddle Inference, ONNX Runtime, or OpenCV, allowing developers to integrate optical character recognition (OCR) into .NET applications with low memory overhead and cross-platform compatibility.

How it works

The library uses a managed ONNX interpreter with custom-written kernels and GEMM (General Matrix Multiply) operators optimized for multiple platforms. It supports various SIMD instruction sets (AVX, AVX2, AVX-512/VNNI on x64 and AdvSIMD on ARM64) to accelerate computation. The core API accepts raw interleaved pixel memory (such as BGR24, RGB24, BGRA32, or RGBA32), meaning it does not handle image decoding itself, which prevents it from forcing specific image libraries on the user.

Who it’s for

.NET developers who need to implement OCR functionality in their software without relying on native C++ binaries or complex environment setups, particularly those targeting high-performance CPU-only inference on Windows, Linux, or macOS.

Highlights

  • Zero Native Dependencies: Pure C# implementation that doesn't require Paddle Inference or ONNX Runtime.
  • Hardware Accelerated: Automatically detects and uses the best available SIMD instructions (AVX2, AVX-512, NEON) for maximum speed.
  • Memory Efficient: Low memory requirements and optimized working sets to reduce overhead.
  • Flexible Image Input: Compatible with popular .NET image libraries like ImageSharp, SkiaSharp, OpenCvSharp, and System.Drawing via raw memory spans.
  • Native AOT Compatible: Supports Native AOT publishing for faster startup and smaller binaries.

Related

  • Project
  • Project
  • Project
  • Project