UNPKG

client-side-ocr

Version:

High-performance client-side OCR with ONNX Runtime, RapidOCR and PPU PaddleOCR integration. 100+ language support. Process text from images entirely in the browser with state-of-the-art accuracy and complete privacy.

71 lines (51 loc) 2.12 kB
# client-side-ocr High-performance client-side OCR library with ONNX Runtime, supporting 100+ languages. Process text from images entirely in your browser with complete privacy. [![npm version](https://img.shields.io/npm/v/client-side-ocr.svg)](https://www.npmjs.com/package/client-side-ocr) [![License](https://img.shields.io/npm/l/client-side-ocr.svg)](https://github.com/siva-sub/client-ocr/blob/main/LICENSE) ## Features - 🚀 **100% Client-Side**: All processing happens in the browser - 🌍 **100+ Languages**: Comprehensive multi-language support - 🔒 **Complete Privacy**: Your data never leaves your device -**High Performance**: GPU acceleration with WebGL - 📦 **Small Size**: 15-30MB total (cached after first use) - 🎯 **Multiple Models**: RapidOCR and PPU PaddleOCR support - 📱 **PWA Ready**: Works offline after initial load ## Installation ```bash npm install client-side-ocr ``` ## Quick Start ```typescript import { createRapidOCREngine } from 'client-side-ocr'; // Create OCR engine const ocr = createRapidOCREngine({ language: 'en', // or 'ch', 'ja', 'ko', etc. modelVersion: 'PP-OCRv4' }); // Initialize (downloads models if needed) await ocr.initialize(); // Process an image const result = await ocr.processImage(imageFile); console.log(result.text); ``` ## React Component ```tsx import { RapidOCRInterface } from 'client-side-ocr/react'; function App() { return ( <RapidOCRInterface defaultLanguage="en" onResult={(result) => console.log(result.text)} /> ); } ``` ## Documentation - [Live Demo](https://siva-sub.github.io/client-ocr/) - [Full Documentation](https://github.com/siva-sub/client-ocr#readme) - [Usage Guide](https://github.com/siva-sub/client-ocr/blob/main/docs/USAGE.md) - [API Reference](https://github.com/siva-sub/client-ocr/blob/main/docs/API.md) ## Supported Languages English, Chinese, Japanese, Korean, French, German, Spanish, Portuguese, Italian, Russian, Arabic, Hindi, Vietnamese, Indonesian, Persian, Kannada, and 80+ more languages. ## License MIT © [Sivasubramanian Ramanathan](https://sivasub.com)