ocrs

Library Featured

OCR engine

Checked · Sources

Downloads
196,739
Dependents
20
Stars
1,915
Forks
92
Contributors
12
Commits
570
Latest release
0.13.1 ·

About

From the project README ·

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

Under the hood, the library uses neural network models trained in PyTorch, which are then exported to ONNX and executed using the RTen engine. See the models section for more details.

Status

ocrs is currently in an early preview. Expect more errors than commercial OCR engines.

Language Support

ocrs currently recognizes the Latin alphabet only (eg. English). Support for more languages is planned.

CLI installation

To install the CLI tool, you will first need Rust and Cargo installed. Then run:

$ cargo install ocrs-cli --locked
Read the full README

To enable support for reading images from the system clipboard, add the clipboard feature:

$ cargo install ocrs-cli --locked --features clipboard

CLI usage

To extract text from an image, run:

$ ocrs image.png

When the tool is run for the first time, it will download the required models automatically and store them in ~/.cache/ocrs.

If ocrs was installed with the clipboard feature, you can extract text from an image on the system clipboard with:

$ ocrs --clipboard
$ ocrs -c  # Short form
Additional examples

Extract text from an image and write to content.txt:

$ ocrs image.png -o content.txt

Extract text and layout information from the image in JSON format:

$ ocrs image.png --json -o content.json

Annotate an image to show the location of detected words and lines:

$ ocrs image.png --png -o annotated.png

Library usage

See the ocrs crate README for details on how to use ocrs as a Rust library.

Models and datasets

ocrs uses neural network models written in PyTorch. See the ocrs-models repository for more details about the models and datasets, as well as tools for training custom models.

Development

To build and run the ocrs library and CLI tool locally you will need a recent stable Rust version installed. Then run:

git clone https://github.com/robertknight/ocrs.git
cd ocrs
cargo run -p ocrs-cli -r -- image.png

Common development tasks are defined as recipes in the justfile and run with just. Run just --list to see them all.

Testing

Ocrs has unit tests for the code that runs before and after ML model processing, plus E2E tests which exercise the whole pipeline, including models.

After making changes to the code, run unit tests and lint checks with:

just check

You can also run standard commands like cargo test directly.

Run the E2E tests with:

just test-e2e

For details of how the ML models are evaluated, see the ocrs-models repository.

Runs on
GPU support unknown
What shows it
  • no dependency or feature matches a backend row
Native code
None found
  • No native code found
Python bindings
No Python binding crate found
License
Apache-2.0 OR MIT

Compare with similar projects

Order: strongest tier first, then most downloads, then name, with unmeasured values last. A library counts downloads over 30 days. An app counts binary downloads per release. An app with none counts its crate downloads over 30 days.

ocrs beside the projects that share a topic with it
ProjectDownloadsDependentsStarsLatest releaseRuns on (GPU)Native codeLicense
ocrs This page Featured

OCR engine

196,739 downloads over 30 days 20 1,915 0.13.1 GPU support unknown No native code found Apache-2.0 OR MIT
oar-ocr Listed

An Optical Character Recognition (OCR) and Document Layout Analysis library written in Rust.

34,387 downloads over 30 days 9 204 0.10.2 CUDA, WebGPU, Metal Binds native code: ort-sys Apache-2.0
tesseract-rs Listed Dormant

Higher-level bindings for Tesseract OCR

24,101 downloads over 30 days 12 176 0.15.2 GPU support unknown Binds native code: tesseract-sys, leptonica-sys MIT

A lightweight and efficient OCR library based on PaddleOCR models, using the MNN inference framework for high-performance text detection and recognition

2,742 downloads over 30 days 5 346 2.4.1 CUDA, Metal, Vulkan Build uses a native toolchain: bindgen, cc, cmake Apache-2.0

RustO! - Pure Rust OCR library based on RapidOCR with PaddleOCR engine

1,618 downloads over 30 days 1 127 0.3.2 CUDA, Metal, Vulkan Binds native code: rusto-mnn-sys. Build uses a native toolchain: bindgen, cc, cmake MIT

Pure-Rust, CPU-hyper-optimized runner for the Baidu Unlimited-OCR model (single-binary CLI: focr)

40 downloads over 30 days 0 346 0.9.0 GPU support unknown No native code found Not measured
Why FeaturedIt passes every Featured gate.

What it meets

  • It has 16 active dependents and 15 new dependents in 365 days. Featured needs 11 active dependents or 9 new dependents in 365 days.
  • Active dependents are at 100% of their peak. Featured needs at least 50%.
  • Docs are present. The release commit or a manifest ties the crate to the repository.
  • No vulnerability advisory stays unpatched past the grace window. At least one version is neither a prerelease nor 0.0.x.
  • The last activity is on 8 Nov 2026, 1 day ago. The rules expect an update within 1200 days. Dormancy rule

Exact rules: Featured library. The check on applied thresholds version 9.

Every rule outcome, as the check records it
  • expected-interval: version 0.13.1 base 300, doubled for 196739 downloads per month, doubled for 16 active users: E = 1200 days
  • dormancy: last activity 2026-11-08, 1 days ago, E = 1200: active
  • featured: featured: active_users 16, new_adopters 15, former_glory 1
Crates2 crates

Measurements and sources

Each signal row shows the raw value, its source and the fetch date. The Sources list gathers every distinct source on this page. Movement needs more history.

Sources6 sources
Adoption16 active dependents, 15 new dependents in 365 days1 not measured
Adoption measurements
SignalValueSourceFetchedCounts
Active dependents16crates.io database dumpYes
New dependents (365 days)15crates.io database dumpYes
Peak active dependents15.5crates.io database dumpYes
Active dependents as a share of the peak1crates.io database dumpYes
Binary downloads per releaseNot measuredYes
MaintenanceLatest human commit: 1 day ago3 not measured
Maintenance measurements
SignalValueSourceFetchedCounts
Latest human commit2026-11-08GitHub repositoryYes
Latest release2026-09-13crates.io database dumpYes
First release2023-12-31crates.io database dumpYes
Latest version0.13.1crates.io database dumpYes
Days the oldest outside issue waits for a reply0GitHub repositoryYes
Maintainer replies over 365 days24GitHub repositoryYes
Repository archivedfalseGitHub repositoryYes
Repository gonefalseGitHub repositoryYes
Release commit or manifest in the repotruecrates.io packageYes
Published docstruecrates.io database dumpYes
Latest release fails cargo checkNot measuredYes
Build check dateNot measuredYes
Build check toolchainNot measuredYes
SecurityUnpatched vulnerabilities: none
Security measurements
SignalValueSourceFetchedCounts
Unpatched vulnerabilities past the grace windownoneRustSec advisory databaseYes
RustSec unmaintained advisorynoneRustSec advisory databaseYes
Deprecation noticenonecrates.io database dumpYes
Deprecated requirementnonecrates.io database dumpYes
Distribution21 releases, 196,739 downloads over 30 days5 not measured
Distribution measurements
SignalValueSourceFetchedCounts
Releases21crates.io database dumpYes
Downloads over 30 days196739crates.io database dumpYes
Binary downloads over the last 3 releasesNot measuredYes
Homebrew installs on request over 365 daysNot measuredYes
Repology repository familiesNot measuredYes
Docker pull growth over 90 daysNot measuredYes
Docker pulls at the growth baselineNot measuredYes
Every version a prereleasefalsecrates.io database dumpYes
Every version 0.0.xfalsecrates.io database dumpYes
Every version yankedfalsecrates.io database dumpYes
Crate deleted from crates.iofalsecrates.io database dumpYes
Repository1,915 stars, 92 forks, 12 contributors, 570 commits. Stars alone never qualify a project.
Repository measurements
SignalValueSourceFetchedCounts
GitHub stars1915GitHub repositoryYes — one part of the repository route
GitHub forks92GitHub repositoryYes — one part of the repository route
Contributors with a GitHub account12GitHub contributorsYes — one part of the repository route
Commits on the default branch570GitHub repositoryNo
Repository's main crate left out of the entrynonecrates.io database dumpYes
Facts that never count
Facts that never count measurements
SignalValueSourceFetchedCounts
LicenseApache-2.0 OR MITcrates.io database dumpNo
Runs on, from listed crates and their direct dependenciesGPU support unknowncrates.io database dumpNo
What shows each backendno dependency or feature matches a backend rowcrates.io database dumpNo
Native code, from listed crates and their dependenciesNo native code foundcrates.io database dumpNo
Python bindings, from direct dependencies of listed cratesNo Python binding crate foundcrates.io database dumpNo
Crates that depend on a listed crate directly20crates.io database dumpNo

Corrections and review history

Report a correction

No correction applies to this entry.

Judgments

A judgment enters only through an approved issue and a merged pull request.

No judgment applies to this entry.