EasyOcrSharp.Runtime
1.0.1
dotnet add package EasyOcrSharp.Runtime --version 1.0.1
NuGet\Install-Package EasyOcrSharp.Runtime -Version 1.0.1
<PackageReference Include="EasyOcrSharp.Runtime" Version="1.0.1" />
<PackageVersion Include="EasyOcrSharp.Runtime" Version="1.0.1" />
<PackageReference Include="EasyOcrSharp.Runtime" />
paket add EasyOcrSharp.Runtime --version 1.0.1
#r "nuget: EasyOcrSharp.Runtime, 1.0.1"
#:package EasyOcrSharp.Runtime@1.0.1
#addin nuget:?package=EasyOcrSharp.Runtime&version=1.0.1
#tool nuget:?package=EasyOcrSharp.Runtime&version=1.0.1
<div align="center"> <img src="icon.png" alt="EasyOcrSharp.Runtime Logo" width="128" height="128"> <h1>EasyOcrSharp.Runtime</h1>
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
EasyOcrSharpon 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.
Direct Installation (Not Recommended)
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
- Installation: When
EasyOcrSharpis installed, NuGet automatically installsEasyOcrSharp.Runtime - 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
- Windows:
- Direct Access:
EasyOcrSharpuses the runtime directly from the NuGet cache - no copying required - Model Downloads: On first use,
EasyOcrSharpdownloads 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:
- Exact Match: Same version (e.g., 2.0.1 ↔ 2.0.1) - Perfect compatibility
- Compatible Version: Same major.minor (e.g., 2.0.1 ↔ 2.0.3) - Fully compatible
- 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:
- Ensure
EasyOcrSharp.Runtimeis installed - Check that the package is in your NuGet cache
- Verify the package version matches what
EasyOcrSharpexpects
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.
Related Packages
- EasyOcrSharp - The main OCR library that uses this runtime package
License
Distributed under the MIT License. See LICENSE for details.
Support
- 📦 NuGet Package: EasyOcrSharp.Runtime on NuGet
- 🐛 Issues: GitHub Issues
- 📖 Documentation: See the main EasyOcrSharp README
<div align="center"> Part of the EasyOcrSharp project </div>
| Product | Versions 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. |
-
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.