💗.NET Wrapper for PaddleInference
C API, include PaddleOCR, PaddleDetection, support Windows(x64), NVIDIA GPU and Linux(Ubuntu-20.04 x64).
PaddleOCR support 14 OCR languages model download on-demand, allow rotated text angle detection, 180 degree text detection.
PaddleDetection support PPYolo detection model and PicoDet model.
NuGet Packages/Docker Images
Note: Linux does not need a native binding NuGet
package like windows(Sdcb.PaddleInference.runtime.win64.mkl
), instead, you can/should based from a Dockerfile to development:
Usage
- PaddleOCR: PaddleOCR
- PaddleDetection: PaddleDetection
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 Studio
installed) Otherwise, it will failed with following error(Windows only):DllNotFoundException: Unable to load DLL 'paddle_inference_c' or one of its dependencies (0x8007007E)
-
Many old CPUs does not support AVX instructions, please ensure your CPU supports AVX, or download the x64-noavx-openblas dlls and disable Mkldnn:
PaddleConfig.Defaults.UseMkldnn = false;
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.cuda11_cudnn8_tr7
instead ofSdcb.PaddleInference.runtime.win64.mkl
, do not install both. - Install CUDA from NVIDIA, and configure environment variables to
PATH
orLD_LIBRARY_PATH
(linux) - Install cuDNN from NVIDIA, and configure environment variables to
PATH
orLD_LIBRARY_PATH
(linux) - Install TensorRT from NVIDIA, and configure environment variables to
PATH
orLD_LIBRARY_PATH
(linux)
You can refer 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 follow the CUDA/cuDNN/TensorRT configuration tasks.
After these steps completed, you can try specify PaddleConfig.Defaults.UseGpu = true
in begin of your code and then enjoy😁.
Thanks & Sponsors
- iNeuOS工业互联网操作系统:http://www.ineuos.net
Contact
QQ group of C#/.NET computer vision technical communicate(C#/.NET计算机视觉技术交流群): 579060605