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.
Next page: Page 2 – In Operation and Summary
Pages in this article:
Page 1 – Introduction and Installation
Page 2 – In Operation and Summary
Given the weights are not open source, is this really compatible with an open source license? I’m not a legal expert.
That’s a good question. There are lots of open source projects that have CC elements. You see that all the time in open source games.
This really needs text recognition. When is that going to be implemented?
Soon.