# PaddleSharp for .NET OCR and Paddle Inference

> PaddleSharp is a C# binding for Baidu's PaddleInference C API, with wrappers for OCR, object detection, rotation detection, Chinese segmentation, and model export. It suits .NET teams that need local inference on documented Windows, Linux, and selected NVIDIA GPU configurations.

**sdcb/PaddleSharp** — .NET/C# binding for Baidu paddle inference library and PaddleOCR

- Repository: https://github.com/sdcb/PaddleSharp
- Stars: 1,457 · Forks: 250
- Language: C#
- License: Apache-2.0
- Published: 2026-10-16 · Updated: 2026-10-16 · Language: en
- Canonical page: https://hysenlabs.com/projects/sdcb-paddlesharp

## What PaddleSharp brings to a .NET application

PaddleSharp addresses a specific integration problem: using Baidu's Paddle inference and PaddleOCR capabilities from C# instead of maintaining a separate native integration by hand. Its main package, Sdcb.PaddleInference, is described as a .NET binding for the PaddleInference C API. Around that binding, the repository provides access to PaddleOCR, PaddleDetection models, rotation detection, PaddleNLP Chinese segmentation, and Paddle2Onnx export. This makes it relevant to .NET applications that process images or run models locally. The README does not describe PaddleSharp as a general-purpose training framework or a managed model ecosystem. Its center of gravity is inference, particularly access to supported models through the native Paddle runtime. The project also lists Windows x64, Ubuntu-22.04 x64, and NVIDIA CUDA 11.8 or later configurations. Those platform statements are narrower than a blanket claim of cross-platform support, so the target machine and GPU must be matched to a package before deployment. It is best understood as a bridge between a managed .NET application and a platform-specific native inference stack.

## How the PaddleInference binding is organized

The repository layout separates managed code, tests, documentation, and build assets through directories such as src/, tests/, docs/, and build/. The package model follows a similar separation. Sdcb.PaddleInference is the infrastructure package and represents the .NET binding to the PaddleInference C API. Separate runtime packages supply the native components. On Windows, the README lists CPU packages based on MKL or OpenBLAS, including Sdcb.PaddleInference.runtime.win64.openblas-noavx for older CPUs. It also lists CUDA-specific packages for GTX 10, RTX 20, RTX 30, and RTX 40 series, with different CUDA and cuDNN combinations. The runtime package naming shows that native compatibility is part of the deployment decision. A managed C# package alone is therefore not the complete installation story. An application needs a binding plus a native runtime package selected for its CPU or NVIDIA GPU. This arrangement gives application code a common managed surface while leaving processor, driver, and GPU compatibility outside that surface. The README does not document a runtime selection algorithm, API initialization sequence, or model-loading code in its package table, so those implementation details should not be inferred from package names alone.

## OCR, detection, and text orientation support

PaddleOCR is the most visible feature in the README. The documentation states that it can download models for 14 OCR languages on demand. It also supports rotated text angle detection, 180-degree text detection, and table recognition. These capabilities suit applications handling scanned documents, photographed text, receipts, forms, or images whose orientation is not controlled. The repository separately documents rotation detection through Baidu's official text_image_orientation_infer model. According to the README, that model detects a text image rotation angle of 0, 90, 180, or 270. The separation matters. OCR performs recognition, while rotation detection identifies image orientation. An application can therefore reason about orientation as its own processing stage rather than treating every rotation concern as part of text output. PaddleDetection support includes PPYolo and PicoDet, so PaddleSharp is not limited to text extraction. It can also expose supported object detection models. The README does not state image-size limits, confidence thresholds, batching behavior, model output formats, or application-level latency. Those details must be checked in the linked detection documentation or through the exposed API. The presence of model families is concrete evidence of scope, but it is not evidence that every supported model is appropriate for a particular production workload.

## PaddleSharp installation and first use

The README identifies NuGet packages but does not give an installation command, project template, initialization snippet, or executable first-use example. It directs readers to the GitHub releases page for release notes and links the Sdcb.PaddleInference package. Because the README does not publish an exact CLI command or C# call, this review does not invent one. A reader should first obtain the infrastructure package and select one native runtime package matching the machine. For CPU deployment on Windows x64, the README identifies Sdcb.PaddleInference.runtime.win64.mkl as the recommended option for most users. It also lists OpenBLAS and no-AVX variants for CPU-specific situations. NVIDIA deployments require choosing a package whose CUDA version and GPU series match the host. Package descriptions mention Linux and macOS support, while the introductory platform list specifically calls out Windows x64 and Ubuntu-22.04 x64. That difference makes release-specific documentation important. The first real use should be checked against the linked OCR or detection documentation for model selection, input handling, initialization, and output interpretation. Without those details, an installation-only tutorial would stop before the application performs inference, so the README's NuGet and documentation links are the most specific supported starting instructions.

## Native runtimes, platforms, and upgrade cost

PaddleSharp has a meaningful platform and dependency surface. The Windows GPU packages are not interchangeable across every system. The README distinguishes CUDA 11.8, CUDA 12.6, and CUDA 12.9 packages, and it maps packages to GPU families including GTX 10, RTX 20, RTX 30, and RTX 40 series. It also lists a CUDA 12.9 package with an SM120 designation, although the package table excerpt ends before its description is complete. CPU users must choose among MKL, OpenBLAS, and no-AVX builds. These choices affect installation, deployment images, hardware compatibility, and upgrades. A change of processor generation or GPU may require changing the native runtime package rather than updating only the C# project. The repository is not archived, and its last push was on 2026-08-30. Listed releases include 3.0.1 on 2025-06-23, 3.0 on 2025-06-14, and 2.5.0.1 on 2024-06-14. The README does not document a complete compatibility matrix for every release, a rollback procedure, or the exact migration steps for updating the native Paddle runtime. The Apache-2.0 license governs use and redistribution under its terms, but package selection and hardware compatibility remain separate engineering questions. License acceptance does not remove the cost of matching runtime packages or retesting model behavior after an upgrade.

## Where PaddleSharp is the wrong choice

PaddleSharp is a poor fit when an application needs a model runtime whose deployment matrix does not match the listed native packages. The README specifically emphasizes Windows x64 and Ubuntu-22.04 x64, with Linux and macOS mentioned elsewhere, so it should not be treated as automatically portable across every .NET target. It is also not the right abstraction when the requirement is only to execute an ONNX model and the application does not need Paddle-specific OCR, detection, segmentation, rotation detection, or export features. Paddle2Onnx allows a Paddle model to be exported to ONNX using C#, but that does not make PaddleSharp a necessary execution layer for every ONNX workflow. Another mismatch is GPU selection: installing the managed package does not remove the need to align CUDA, cuDNN, GPU architecture, and a native runtime package. PaddleOCR's 14-language model download support does not establish accuracy for a particular language, document type, font, or input quality. Nor does the presence of PPYolo and PicoDet models establish that either model satisfies a target workload. Those claims would require model-specific documentation and evaluation rather than reliance on the feature list.

## PaddleSharp compared with direct ONNX execution

PaddleSharp has a different center from a direct ONNX execution path. Direct ONNX execution centers on loading an exported graph through an ONNX runtime. PaddleSharp centers on the PaddleInference C API and adds PaddleOCR, PaddleDetection, rotation detection, PaddleNLP Chinese segmentation, and Paddle2Onnx export. That makes it more useful when a .NET application wants the documented Paddle model workflows, but it also introduces native Paddle runtime packages and hardware-specific choices. The repository's Paddle2Onnx support provides a useful boundary: a team may use C# to export a Paddle model to ONNX and then choose another runtime for execution. The README does not document runtime feature parity, package compatibility, output equivalence, or relative performance between those paths. The practical distinction is architectural. PaddleSharp keeps an application close to Paddle's native inference API and task wrappers. An ONNX-centered approach focuses on an exported model artifact and an ONNX execution engine. The choice depends on whether the project needs Paddle's documented task features or simply needs to execute a model through a separate ONNX runtime.

## Conclusion

Adopt PaddleSharp when a .NET application needs direct access to Paddle models, especially its OCR or detection features. Do not adopt it as a general machine learning runtime without checking native runtime compatibility, model availability, and GPU package alignment first. Verify the package and CUDA combination against the host before deployment.

## FAQ

### Which platforms does PaddleSharp support?

The README specifically lists Windows x64 and Ubuntu-22.04 x64, and it also mentions Linux and macOS support in package descriptions and release information. Check the release documentation for the exact platform matrix.

### How do I install PaddleSharp in a .NET project?

The README points to NuGet and identifies Sdcb.PaddleInference plus separate native runtime packages. It does not provide an exact install command or first-run code example, so the listed package names and linked release documentation are the supported starting points.

### Does PaddleSharp support GPU inference?

The README lists Windows native packages for NVIDIA CUDA 11.8, 12.6, and 12.9 configurations, with packages mapped to GPU series. The selected package must match the host GPU and CUDA environment.

## Sources

- [Issues](https://github.com/sdcb/PaddleSharp/issues)
- [License: Apache-2.0](https://github.com/sdcb/PaddleSharp/blob/master/LICENSE)
- [README](https://github.com/sdcb/PaddleSharp/blob/master/README.md)
- [Releases](https://github.com/sdcb/PaddleSharp/releases)
- [sdcb/PaddleSharp on GitHub](https://github.com/sdcb/PaddleSharp)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/sdcb-paddlesharp
