OCR Tools

Surya – multilingual document OCR toolkit

Surya is billed as a multilingual document OCR toolkit. It’s a CLI-based utility that can be used with a CPU or GPU.

This is free and open source software.

Installation

To run Surya you’ll need Python 3.9 or higher and PyTorch, the latter provides libraries for basic tensor manipulation on CPUs or GPUs, a built-in neural network library, model training utilities, and a multiprocessing library that can work with shared memory.

We tested Surya with a system hosting a NVIDIA GPU, as well as with an Intel NUC 13 Pro which only has onboard Intel Iris Xe. We’ll go through installing the CPU version of PyTorch so we can use Surya with the NUC.

There are a variety of ways to avoid polluting our Ubuntu-based NUC system. We’ll install Surya in a isolated Python environment.

$ sudo apt install python3-venv -y

$ mkdir pytorch_env
$ cd pytorch_env

Create the environment:

$ python3 -m venv pytorch_env
$ source pytorch_env/bin/activate

To install PyTorch with CPU support only, run:

$ pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu

We can now install Surya with the command:

$ pip install surya-ocr

On the first run, the model weights are automatically downloaded, as shown in the image below.

Surya

Next page: Page 2 – In Operation and Summary

Pages in this article:
Page 1 – Introduction and Installation
Page 2 – In Operation and Summary

Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

4 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Craig
Craig
3 months ago

Given the weights are not open source, is this really compatible with an open source license? I’m not a legal expert.

James
James
3 months ago

This really needs text recognition. When is that going to be implemented?

Damien
Damien
3 months ago
Reply to  James

Soon.