PaddleOcrNet.Gpu 2.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package PaddleOcrNet.Gpu --version 2.0.2
                    
NuGet\Install-Package PaddleOcrNet.Gpu -Version 2.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="PaddleOcrNet.Gpu" Version="2.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PaddleOcrNet.Gpu" Version="2.0.2" />
                    
Directory.Packages.props
<PackageReference Include="PaddleOcrNet.Gpu" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add PaddleOcrNet.Gpu --version 2.0.2
                    
#r "nuget: PaddleOcrNet.Gpu, 2.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package PaddleOcrNet.Gpu@2.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=PaddleOcrNet.Gpu&version=2.0.2
                    
Install as a Cake Addin
#tool nuget:?package=PaddleOcrNet.Gpu&version=2.0.2
                    
Install as a Cake Tool

PaddleOcrNet.Gpu

CUDA GPU acceleration for PaddleOcrNet — high-accuracy native .NET OCR powered by PaddleOCR's neural models on ONNX Runtime.

This is a metapackage. It contains no code of its own: it pulls in PaddleOcrNet together with Microsoft.ML.OnnxRuntime.Gpu, so the CUDA execution provider is present at runtime and PaddleOcrNet can select it.

dotnet add package PaddleOcrNet.Gpu

Installing this package instead of PaddleOcrNet is all that is required — it brings the core library with it.

Usage

There is no separate GPU API. Existing code is unchanged; PaddleOcrNet detects the CUDA provider and uses it automatically:

using PaddleOcrNet.Models;
using PaddleOcrNet.Services;

await using var ocr = new PaddleOcrService();

OcrResult result = await ocr.ExtractTextFromImage("invoice.png", OcrLanguage.English);

Console.WriteLine(result.UsedGpu);   // true when a GPU provider was selected
Console.WriteLine(result.FullText);

ExecutionProvider defaults to OcrExecutionProvider.Auto, which probes the loaded ONNX Runtime and picks the best accelerator available, falling back to CPU when none is:

Platform Auto-detect order
Windows DirectML → CUDA → CPU
Linux CUDA → CPU
macOS CoreML → CPU

To pin a provider rather than auto-detecting:

await using var ocr = new PaddleOcrService(new PaddleOcrServiceOptions
{
    ExecutionProvider = OcrExecutionProvider.Cuda,   // or Cpu / DirectMl / CoreMl / Auto
});

PaddleOcrServiceOptions.UseGpu = true is kept as shorthand for forcing CUDA, but prefer leaving ExecutionProvider at Auto — it already enables a GPU when one is present.

Requirements

  • An NVIDIA GPU with the proprietary driver installed, and CUDA 12+.
  • Windows or Linux. Microsoft.ML.OnnxRuntime.Gpu ships native assets for those two platforms only. On macOS this package has nothing to contribute; install plain PaddleOcrNet and let Auto select CoreML.

If CUDA is unavailable at runtime — no driver, missing libraries, no compatible device — provider selection logs the reason and falls back to CPU rather than throwing. OcrResult.UsedGpu reports what was actually used, so a silent fallback is still observable.

Notes

  • Install either PaddleOcrNet or PaddleOcrNet.Gpu, not both — this package already references the core library and pins it to a matching version.
  • The GPU packages add a substantial native payload. For CPU-only deployments, and for Native AOT, trimmed or container images where size matters, use plain PaddleOcrNet.
  • OCR models are downloaded and cached on first use exactly as with the CPU package; GPU selection does not change model sourcing.

License

MIT © PaddleOcrNet contributors. Downloaded models are Apache-2.0 / MIT and attributed to their authors.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.4.1 167 11/15/2026
2.4.0 217 10/16/2026
2.3.1 178 10/13/2026
2.3.0 173 10/12/2026
2.2.1 189 9/29/2026
2.2.0 241 9/14/2026
2.1.0 234 9/4/2026
2.0.4 229 9/4/2026
2.0.3 223 9/1/2026
2.0.2 247 8/28/2026
2.0.1 238 8/27/2026
2.0.0 241 8/26/2026
1.0.0 359 6/21/2026