sdcb/PaddleSharp
sdcb/PaddleSharp has 1,459 GitHub stars and 250 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-08 05:23 UTC. Last push 2026-08-30.
.NET/C# binding for Baidu paddle inference library and PaddleOCR
Measured star growth
- in 24h
- 0
- in 7 days
- Collecting history
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
OriginalPaddleSharp 🌟

💗 .NET Wrapper for PaddleInference C API, support Windows(x64) 💻, NVIDIA Cuda 11.8+ based GPU 🎮 and Linux(Ubuntu-22.04 x64) 🐧, currently contained following main components:
- PaddleOCR 📖 support 14 OCR languages model download on-demand, allow rotated text angle detection, 180 degree text detection, also support table recognition 📊.
- PaddleDetection 🎯 support PPYolo detection model and PicoDet model 🏹.
- RotationDetection 🔄 use Baidu's official
text_image_orientation_infermodel to detect text picture's rotation angle(0, 90, 180, 270). - PaddleNLP ChineseSegmenter 📚 support
PaddleNLPLac Chinese segmenter model, supports tagging/customized words. - Paddle2Onnx 🔄 Allow user export
ONNXmodel usingC#.
NuGet Packages/Docker Images 📦
Release notes 📝
Please checkout this page 📄.
Infrastructure packages 🏗️
| NuGet Package 💼 | Version 📌 | Description 📚 |
|---|---|---|
| Sdcb.PaddleInference | Paddle Inference C API .NET binding ⚙️ |
Native Packages 🏗️
Package Selection Guide:
- We recommend
Sdcb.PaddleInference.runtime.win64.mklfor most users. It offers the best balance between performance and package size. Please note that this package does not support GPU acceleration, making it suitable for most general scenarios. openblas-noavxis tailored for older CPUs that do not support the AVX2 instruction set.- The remaining packages cover various CUDA combinations (GPU acceleration), supporting three CUDA versions:
- CUDA 11.8: Supports 10–40 series NVIDIA GPUs
- CUDA 12.6: Supports 10–40 series NVIDIA GPUs
- CUDA 12.9: Supports 10–50 series NVIDIA GPUs
Important:
Not all GPU packages are suitable for every card. Please refer to the following GPU-to-sm suffix mapping:
sm Suffix |
Supported GPU Series |
|---|---|
| sm61 | GTX 10 Series |
| sm75 | RTX 20 Series (and GTX 16xx series such as GTX 1660) |
| sm86 | RTX 30 Series |
| sm89 | RTX 40 Series |
| sm120 | RTX 50 Series (supported by CUDA 12.9 only) |
Any other packages that starts with Sdcb.PaddleInference.runtime might deprecated.
All packages were compiled manually by me, with some code patches from here: https://github.com/sdcb/PaddleSharp/blob/master/build/capi.patch
Paddle Devices
Mkldnn -
PaddleDevice.Mkldnn()Based on Mkldnn, generally fast
Openblas -
PaddleDevice.Openblas()Based on openblas, slower, but dependencies file smaller and consume lesser memory
Onnx -
PaddleDevice.Onnx()Based on onnxruntime, is also pretty fast and consume less memory
Gpu -
PaddleDevice.Gpu()Much faster but relies on NVIDIA GPU and CUDA
If you wants to use GPU, you should refer to FAQ
How to enable GPU?section, CUDA/cuDNN/TensorRT need to be installed manually.
FAQ ❓
Why my code runs good in my windows machine, but DllNotFoundException in other machine: 💻
Please ensure the latest Visual C++ Redistributable was installed in
Windows(typically it should automatically installed if you haveVisual Studioinstalled) 🛠️ Otherwise, it will fail with the following error (Windows only):DllNotFoundException: Unable to load DLL 'paddle_inference_c' or one of its dependencies (0x8007007E)If it's Unable to load DLL OpenCvSharpExtern.dll or one of its dependencies, then most likely the Media Foundation is not installed in the Windows Server 2012 R2 machine:

Many old CPUs do not support AVX instructions, please ensure your CPU supports AVX, or download the x64-noavx-openblas DLLs and disable Mkldnn:
PaddleDevice.Openblas()🚀If you're using Win7-x64, and your CPU does support AVX2, then you might also need to extract the following 3 DLLs into
C:\Windows\System32folder to make it run: 💾- api-ms-win-core-libraryloader-l1-2-0.dll
- api-ms-win-core-processtopology-obsolete-l1-1-0.dll
- API-MS-Win-Eventing-Provider-L1-1-0.dll
You can download these 3 DLLs here: win7-x64-onnxruntime-missing-dlls.zip ⬇️
How to enable GPU? 🎮
Enable GPU support can significantly improve the throughput and lower the CPU usage. 🚀
Steps to use GPU in Windows:
- (for Windows) Install the package:
Sdcb.PaddleInference.runtime.win64.cu120*instead ofSdcb.PaddleInference.runtime.win64.mkl, do not install both. 📦 - Install CUDA from NVIDIA, and configure environment variables to
PATHorLD_LIBRARY_PATH(Linux) 🔧 - Install cuDNN from NVIDIA, and configure environment variables to
PATHorLD_LIBRARY_PATH(Linux) 🛠️ - Install TensorRT from NVIDIA, and configure environment variables to
PATHorLD_LIBRARY_PATH(Linux) ⚙️
You can refer to this blog page for GPU in Windows: 关于PaddleSharp GPU使用 常见问题记录 📝
If you're using Linux, you need to compile your own OpenCvSharp4 environment following the docker build scripts and the CUDA/cuDNN/TensorRT configuration tasks. 🐧
After these steps are completed, you can try specifying PaddleDevice.Gpu() in the paddle device configuration parameter, then enjoy the performance boost! 🎉
Thanks & Sponsors 🙏
- 崔亮 https://github.com/cuiliang
- 梁现伟
- 深圳-钱文松
- iNeuOS工业互联网操作系统:http://www.ineuos.net
Contact 📞
QQ group of C#/.NET computer vision technical communication (C#/.NET计算机视觉技术交流群): 579060605

Explore related projects
codecrafters-io/build-your-own-x
Master programming by recreating your favorite technologies from scratch.
560,905 starspublic-apis/public-apis
A collective list of free APIs
497,149 starsmorluto/rea
Reverse engineer anything with agents, from app behavior down to native binaries.
442,207 starsopenclaw/openclaw
The AI that really does things. Any OS. Any Platform. The lobster way. 🦞
394,173 stars