ocrs

ocrs is a Rust library and CLI tool for extracting text from images, also known as OCR (Optical Character Recognition).

The goal is to create a modern OCR engine that:

  • Works well on a wide variety of images (scanned documents, photos containing text, screenshots etc.) with zero or much less preprocessing effort compared to earlier engines like Tesseract. This is achieved by using machine learning more extensively in the pipeline.
  • Is easy to compile and run across a variety of platforms, including WebAssembly
  • Is trained on open and liberally licensed datasets
  • Has a codebase that is easy to understand and modify

Usage

ocrs can be used as a binary or embedded as a rust crate.

Usage: ocrs [OPTIONS] <image>

Options

OptionDescription
--detect-model <path>Use a custom text detection model
--rec-model <path>Use a custom text recognition model
-j, --jsonOutput text and structure in JSON format
-o, --output <path>Output file path (defaults to stdout)
-p, --pngOutput annotated copy of input image in PNG format