OAR (ONNXRuntime And Rust) OCR
A comprehensive OCR and document understanding library built in Rust with ONNX Runtime.
Quick Start
Installation
With GPU support:
Basic Usage
use *;
use Path;
Document Structure Analysis
use *;
use Path;
Vision-Language Models (VLM)
For advanced document understanding using Vision-Language Models (like PaddleOCR-VL and UniRec), check out the oar-ocr-vl crate.
Documentation
- Usage Guide - Detailed API usage, builder patterns, GPU configuration
- Pre-trained Models - Model download links and recommended configurations
Examples
The examples/ directory contains complete examples for various tasks:
# General OCR
# Document Structure Analysis
# Layout Detection
# Table Structure Recognition
Acknowledgments
This project builds upon the excellent work of several open-source projects:
-
ort: Rust bindings for ONNX Runtime by pykeio. This crate provides the Rust interface to ONNX Runtime that powers the efficient inference engine in this OCR library.
-
PaddleOCR: Baidu's awesome multilingual OCR toolkits based on PaddlePaddle. This project utilizes PaddleOCR's pre-trained models, which provide excellent accuracy and performance for text detection and recognition across multiple languages.
-
OpenOCR: An open-source toolkit for general OCR research and applications by the FVL Laboratory at Fudan University. We use the UniRec model for unified text, formula, and table recognition.
-
Candle: A minimalist ML framework for Rust by Hugging Face. We use Candle to implement Vision-Language model inference.