EasyOcrSharp.Runtime 1.0.1

dotnet add package EasyOcrSharp.Runtime --version 1.0.1
                    
NuGet\Install-Package EasyOcrSharp.Runtime -Version 1.0.1
                    
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="EasyOcrSharp.Runtime" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EasyOcrSharp.Runtime" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="EasyOcrSharp.Runtime" />
                    
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 EasyOcrSharp.Runtime --version 1.0.1
                    
#r "nuget: EasyOcrSharp.Runtime, 1.0.1"
                    
#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 EasyOcrSharp.Runtime@1.0.1
                    
#: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=EasyOcrSharp.Runtime&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=EasyOcrSharp.Runtime&version=1.0.1
                    
Install as a Cake Tool

<div align="center"> <img src="icon.png" alt="EasyOcrSharp.Runtime Logo" width="128" height="128"> <h1>EasyOcrSharp.Runtime</h1>

NuGet NuGet Downloads License: MIT </div>

Overview

EasyOcrSharp.Runtime is the optimized runtime package for EasyOcrSharp. It contains a minimal Python 3.11 embedded runtime with EasyOCR and core dependencies pre-installed, while pip and PyTorch components are downloaded automatically on first run for significantly reduced package size.

This package is automatically installed as a dependency when you install EasyOcrSharp. You typically don't need to reference it directly in your projects.

What's Included

🐍 Python 3.11 Embedded Runtime

  • Complete Python 3.11 embedded distribution
  • No system Python installation required
  • Works on Windows, Linux, and macOS

📦 Pre-installed Python Packages (Optimized)

Core dependencies pre-bundled for fast startup:

  • easyocr - The OCR engine ⚡ (264s download time saved!)
  • numpy - Numerical computing
  • opencv-python-headless - Computer vision library
  • scipy - Scientific computing
  • scikit-image - Image processing algorithms
  • pyyaml, jinja2, networkx - Supporting libraries
  • All transitive dependencies for the above

📥 Downloaded on First Run (Package Size Optimization)

Components downloaded automatically when needed (with optimized CDN flags):

  • pip - Package installer (bootstrapped via get-pip.py) (~10MB)
  • PyTorch Bundle - Auto-detected based on hardware:
    • 🚀 GPU Version (CUDA detected): ~2.5GB - 10-100x faster OCR
    • 💻 CPU Version (no GPU): ~200MB - Standard performance
  • Pillow - Image processing (~10MB)

Download Optimizations:

  • ✅ PyTorch official CDN (download.pytorch.org)
  • ✅ Trusted host flags for maximum speed
  • ✅ No version checks for faster startup
  • ✅ No caching to ensure latest versions

⚠️ What's NOT Included

  • Language models - Models are downloaded separately on-demand by EasyOcrSharp on first use
  • Models are cached in %LOCALAPPDATA%\EasyOcrSharp\models (or equivalent on Linux/macOS)

Package Structure

The optimized package contains the Python runtime in:

tools/python_runtime/
├── python.exe
├── python311.dll
├── Lib/
│   └── site-packages/
│       ├── easyocr/          ✅ Pre-bundled (biggest time saver!)
│       ├── numpy/            ✅ Pre-bundled
│       ├── opencv-python-headless/ ✅ Pre-bundled
│       ├── scipy/            ✅ Pre-bundled
│       ├── scikit-image/     ✅ Pre-bundled
│       ├── [torch/]          📥 Downloaded on first run
│       ├── [torchvision/]    📥 Downloaded on first run
│       ├── [torchaudio/]     📥 Downloaded on first run
│       ├── [Pillow/]         📥 Downloaded on first run
│       └── ... (other core dependencies)
└── ... (other Python runtime files)

Usage

Automatic Installation

When you install EasyOcrSharp, this package is automatically installed:

dotnet add package EasyOcrSharp

The EasyOcrSharp package automatically references EasyOcrSharp.Runtime as a dependency.

You can install this package directly, but it's not necessary:

dotnet add package EasyOcrSharp.Runtime
<PackageReference Include="EasyOcrSharp.Runtime" Version="1.0.1" />

How It Works

  1. Installation: When EasyOcrSharp is installed, NuGet automatically installs EasyOcrSharp.Runtime
  2. Runtime Location: The Python runtime is located in the NuGet cache at:
    • Windows: %USERPROFILE%\.nuget\packages\easyocrsharp.runtime\<version>\tools\python_runtime
    • Linux/macOS: ~/.nuget/packages/easyocrsharp.runtime/<version>/tools/python_runtime
  3. Direct Access: EasyOcrSharp uses the runtime directly from the NuGet cache - no copying required
  4. Model Downloads: On first use, EasyOcrSharp downloads language models on-demand and caches them

Benefits

  • Zero Python installation - Python 3.11 is pre-bundled
  • Optimized package size - ~200-300MB smaller by excluding PyTorch components
  • Fast EasyOCR startup - EasyOCR (biggest dependency) is pre-bundled to save 264+ seconds
  • Smart dependency management - PyTorch downloads automatically only when needed
  • No pip required - Both pre-bundled and dynamic dependencies handled automatically
  • Cross-platform - Works on Windows, Linux, and macOS
  • Offline capable - After all components are cached, full offline operation

Technical Details

Package Type

This is a tools-only package that contains no .NET assemblies. It only contains the Python runtime and dependencies.

Package Size

The optimized package is significantly smaller (~200-300MB) because it includes:

  • Python 3.11 embedded runtime
  • EasyOCR and core dependencies (biggest time saver pre-bundled)
  • PyTorch components downloaded automatically on first run (saves ~200-300MB package size)

Platform Support

  • ✅ Windows (x64, ARM64)
  • ✅ Linux (x64, ARM64)
  • ✅ macOS (x64, ARM64)

Version Compatibility

The system automatically detects and uses the best compatible runtime version:

EasyOcrSharp Version EasyOcrSharp.Runtime Version Compatibility
2.0.0 2.0.0 ✅ Perfect match
2.0.1 2.0.0 ✅ Compatible (same major.minor)
2.0.0 2.0.1 ✅ Compatible (same major.minor)
2.1.0 2.0.0 ⚠️ Minor version mismatch
3.0.0 2.0.0 ❌ Major version mismatch

Automatic Version Selection

The system uses this priority order when selecting a compatible runtime:

  1. Exact Match: Same version (e.g., 2.0.1 ↔ 2.0.1) - Perfect compatibility
  2. Compatible Version: Same major.minor (e.g., 2.0.1 ↔ 2.0.3) - Fully compatible
  3. Latest Available: Uses the newest runtime available - May work but not optimal

Version Update Scenarios

Scenario: Updating from v1.0.0 to v1.0.1

🔍 EasyOcrSharp v1.0.1 detects available runtimes:
   - EasyOcrSharp.Runtime v1.0.0 ✅ Compatible
   - EasyOcrSharp.Runtime v1.0.1 🎯 Perfect match (preferred)

📦 Copies libraries from v1.0.1 runtime to user-defined directory
✅ All optimizations and bug fixes included

The system ensures you always get the best compatible runtime for your EasyOcrSharp version!

Troubleshooting

Runtime Not Found

If EasyOcrSharp cannot find the runtime:

  1. Ensure EasyOcrSharp.Runtime is installed
  2. Check that the package is in your NuGet cache
  3. Verify the package version matches what EasyOcrSharp expects

Package Size Concerns

The package is large because it includes the complete Python runtime and all dependencies. This is intentional to provide a zero-dependency experience.

  • EasyOcrSharp - The main OCR library that uses this runtime package

License

Distributed under the MIT License. See LICENSE for details.

Support


<div align="center"> Part of the EasyOcrSharp project </div>

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net9.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on EasyOcrSharp.Runtime:

Package Downloads
EasyOcrSharp

High-accuracy OCR for .NET powered by EasyOCR (Python), with minimal runtime that downloads pip and PyTorch components automatically for reduced package size while keeping EasyOCR pre-bundled for fast startup.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 189 11/26/2025
1.0.0 195 11/26/2025