Skip to content
>sdcb.ai

SimdPaddleOCR

A complete OCR inference engine written entirely in C#. No Paddle Inference, no ONNX Runtime, no native OpenCV.

Install
dotnet add package Sdcb.SimdPaddleOCR
dotnet add package Sdcb.SimdPaddleOCR.Models.ChineseV6Tiny
dotnet add package Sdcb.SimdCodecs
0
native inference deps
913 KB
core package (nupkg, engine included)
0.58%
small-model CER on the 100-image benchmark (official evaluate.py)
11.9×
medium GPU speedup on a 3080 Ti (2.2)

Why

A clean-slate successor to PaddleSharp and OpenVINO.NET

PaddleSharp and OpenVINO.NET brought OCR to a lot of .NET apps — but both drag along tens to hundreds of MB of native runtime. New platform or CPU architecture? New native packages, painful deployment and debugging.

SimdPaddleOCR takes a different route: models are loaded by SimdOnnx, a pure-C# engine shared with SimdGcdrNet and compiled into the core package from source (no extra engine package); convolution, GEMM and friends are hand-written with C# hardware intrinsics, dispatching at runtime to AVX-512, AVX2, SSE4.2, NEON, WASM SIMD128 or portable Vector code. One NuGet package runs everywhere — including NativeAOT, the browser and .NET Framework 4.8.

The core API just takes pixel memory (BGR24 / RGB24 / BGRA32 / RGBA32) and never forces an imaging library on you — use ImageSharp, SkiaSharp, OpenCvSharp or System.Drawing.

Pipeline
pixelsDOCDETCLSREC

DOC page orientation (optional) → DET detect → CLS line orientation → REC recognize

SimdOnnx engine (embedded) · NHWC graph · session cache
Conv · GEMM · Pooling · Activation · Resize — hand-written in C#
AVX-512 · VNNI
x64
AVX2 · FMA
x64
SSE4.2
x64 without AVX
AdvSIMD (NEON)
ARM64
PackedSimd
WASM SIMD128
Vector<T> / scalar
netstandard2.0
Vulkan
cross-platform
Metal
macOS

Teal: GPU backends (since 2.0, net10.0 only). The SSE4.2 and PackedSimd kernels are new in 2.1.

Quick start

Bring your own imaging library

Program.cs
using Sdcb.SimdCodecs;
using Sdcb.SimdCodecs.Abstractions;
using Sdcb.SimdPaddleOCR;
using Sdcb.SimdPaddleOCR.Models.ChineseV6Tiny;

using PaddleOcrAll ocr = await PaddleOcrAll.LoadAsync(ChineseV6TinyModels.Default);
byte[] data = await File.ReadAllBytesAsync("sample.jpg");
// decode straight to BGR24; ApplyOrientation honours EXIF on phone photos
using PixelBuffer image = ImageCodecs.Decode(data, PixelFormat.Bgr24,
    new DecodeOptions { ApplyOrientation = true });

PaddleOcrResult result = ocr.Run(image.Pixels, image.Width, image.Height, image.Stride);
Console.WriteLine(result.Text);

Performance

Faster and leaner, every release

Numbers from the per-device reports in docs/perf.md: 100 mixed-size synthetic images (1036 lines, with line orientation), 4 workers, median wall-clock with warm-up excluded. CPU numbers are re-measured by CI on Windows / Linux / macOS for every change.

RTX 3080 Ti · end-to-end per image

Ryzen 7 5800X CPU vs Vulkan · 100 images · 2.2

CPUVulkan
tiny0.37×
43.5 ms
16.3 ms
small0.27×
113.3 ms
30.5 ms
medium0.08×
498 ms
42 ms

Intel Arc B580 · end-to-end per image

Ryzen 9 5950X CPU vs Vulkan · 100 images · 2.2

CPUVulkan
tiny0.34×
68.2 ms
23.3 ms
small0.23×
151 ms
35.3 ms
medium0.11×
482.4 ms
51.3 ms

Browser WASM · end-to-end per image

Ryzen 7 5800X · Edge · 4 Workers · 2.0.0 vs 2.2 (PackedSimd)

2.0.02.2
tiny0.80×
116.7 ms
92.9 ms
small0.62×
441.8 ms
274.8 ms
medium0.77×
1728.7 ms
1323.7 ms

In the browser, small runs 1.61× faster than 2.0; the AVX-less Pentium G5500 is 1.09–1.27× faster on CPU with the new SSE4.2 kernels, and 2.6–4.2× faster on its MX150 via Vulkan.

Platforms

One package, everywhere

  • Targets net10.0 and netstandard2.0 (incl. .NET Framework 4.8)
  • NativeAOT compatible (IsAotCompatible)
  • Models load straight from embedded resources — no extraction, no temp files
  • Measured on Snapdragon 8 Gen 3, CPU and Vulkan
  • Runs in the browser as browser-wasm — try the playground
OSCPUGPU
Windows
x64x86ARM64
Vulkan
Linux
x64ARM64
Vulkan
macOS
x64ARM64
Metal
Android
ARM64
Vulkan
Browser
wasm
–

Docker · Web API

OCR as a service, one command

Since 2.1 there is an official multi-arch image (linux/amd64 + linux/arm64), built straight by the .NET 10 SDK with zero native dependencies. Then open http://localhost:8080 to try it in the browser.

  • POST /api/ocrdetect + classify + recognize, optional page straightening
  • POST /api/ocr/orientationwhole-page orientation only
  • POST /api/ocr/detecttext detection only
  • POST /api/ocr/classifytext-line orientation only
  • POST /api/ocr/recognizerecognize a single-line image
  • GET /scalarinteractive API docs
bash
docker run --rm -p 8080:8080 sdcb/simdpaddleocr:latest

# full OCR, straightening rotated pages first
curl -F [email protected] -F documentOrientation=true \
  http://localhost:8080/api/ocr

NuGet

Packages & models

Total downloads 27.8k

Releases

Release history

  1. v2.2.0
    Nov 28, 2026
  2. v2.1.0
    Nov 27, 2026
  3. v2.0.0
    Oct 9, 2026
  4. v1.4.2
    Sep 20, 2026
  5. v1.4
    Sep 19, 2026
  6. v1.3.0
    Sep 14, 2026
  7. v1.2.0
    Sep 9, 2026

The series

Dev diary, 0 → 2.x

SimdPaddleOCR 2.0:再快15倍!见证纯C#驱动的GPU性能核弹

大家好,SimdPaddleOCR 今天发布 2.0。这是项目第一次升大版本号,原因很简单:1.x 一直在折腾 CPU 上的 SIMD,2.0 加上了 GPU 后端,Windows / Linux / 安卓走 Vulkan,macOS 走 Metal。在我的 RTX 3080 Ti 上,medium

3k43

Fable 5.1操刀,内存腰斩,外星科技——SimdPaddleOCR 1.4 发布!

大家好,我非常自豪地宣布纯 C# 写的 SimdPaddleOCR 今天发布 1.4 版本,这个版本有许多重大改进,其中有一些甚至说得上是“外星科技”! 对于刚认识这个项目的朋友,先交代一下我们的硬核定位:这是一个纯 C# 实现的 PP-OCRv6 引擎。它不需要 Paddle Inference,

2.3k45

AVX性能暴涨135%,吊打OpenVINO.NET——SimdPaddleOCR 1.3发布!

先看性能跑分,机器是我自己的主力开发机 Ryzen 7 5800X(16 逻辑核,AVX2),Windows 11,PP-OCRv6,4 个行级 worker,仓库里会生成 100 张合成图,去掉第一张预热,统计 99 张,长这个样子: 耗时是每张图的平均毫秒。C 引擎换成了较新的 lw.PPOCR

1.3k26

ARM64端到端再提速40%:SimdPaddleOCR 1.2 发布!

前两天连载了 SimdPaddleOCR 的发布 和 C# 手写向量化的底层逻辑。1.1 版本在 win-x64 上已经基本站稳了脚跟,但短板也很明显:ARM64 环境下虽然能跑,但速度明显慢了一截。 现在 ARM64 早就不是小众平台了——MacBook、手机、Windows on ARM 以及越

1.1k27

C# 手写向量化能追上 C 吗?

昨天发布了 SimdPaddleOCR,评论区和群里最多的一类问题是:纯 C# 写的推理,凭什么比纯 C 还快? 有人觉得肯定是偷偷调了 ONNX Runtime,有人觉得是 C 那边写得太烂,还有人直接说"C# 就不该谈性能"。 这篇不谈 OCR,谈一个更朴素的问题:C# 到底有没有能力写出和 C

1.7k31

SimdPaddleOCR发布——一个纯 C# 的完整 OCR 推理库

今天正式发布 SimdPaddleOCR(NuGet: Sdcb.SimdPaddleOCR)。这是一个完全用 C# 编写的完整 OCR 推理引擎。它不依赖 Paddle Inference,不依赖 ONNX Runtime,也不需要附带 OpenCV 的原生动态链接库。 如果你现在去翻这个 Git

3.2k59
WeChat group QR code

C#/.NET Computer Vision community

Scan to join the WeChat group. The QR code rotates weekly — if it has expired, join QQ group 579060605 instead.