Skip to main content



Github Runner Covergae Status      Github Runner Covergae Status      Github Runner Covergae Status



Universal Character Recognizer (UCR) is an Open Source, Easy to use Python library to build Production Ready OCR applications with its highly Intuitive, Modular & Extensible API design and off-the-shelf Pretrained Models for over 25 languages.

Read UCR Documentation on ucr.docyard.ai

Features • Setup • Usage • Acknowledgement

PyPI - Python Version PyPI version

Demo

For details, click here!

Features

  • Supports SOTA Text Detection and Recognition models
  • Built on top of Pytorch and Pytorch Lightning
  • Supports over 25 languages
  • Model Zoo contains 27 Pretrained Models across 25 languages
  • Modular Design Language allows Pick and Choose of different components
  • Easily extensible with Custom Components and attributes
  • Hydra config enables Rapid Prototyping with multiple configurations
  • Support for Packaging, Logging and Deployment tools straight out of the box

Note: Some features are still in active development and might not be available.

Setup

Installation

Require python version >= 3.6.2, install with pip (recommended)

  1. Prerequisites: Install compatible version of Pytorch and torchvision from official repository.
  2. Installation: Install the latest stable version of UCR:
pip install -U ucr

[Optional] Test Installation

Run dummy tests!

ucr test
# Optional: Add -l/--lang='language_id' to test on particular language!
ucr test -l='en_number'

Usage

Workflow

Execution flow of UCR is displayed above. Broadly it can be divided into 4 sub-parts:

  1. Input (image/folder path or web address) is fed into the Detection model which outputs bounding box coordinates of all the text boxes.
  2. The detected boxes are then checked for Orientation and corrected accordingly.
  3. Next, Recognition model runs on the corrected text boxes. It returns bounding box information and OCR output.
  4. Lastly, an optional Post Processing module is executed to improve/modify the results.

Quick Start

The following code snippet shows how to get started with UCR library.

from ucr import UCR

# initialization
ocr = UCR(lang="en_number", device="cpu")

# run prediction
result = ocr.predict('input_path', output='output_path')

# for saving annotated image
result = ocr.predict('input_path', output='output_path', save_image=True)

For complete list of arguments, refer Argument List

Model Zoo

A collection of pretrained models for detection, classification and recognition processes is present here !
These models can be useful for out-of-the-box inference on over 25 languages.

Acknowledgement

Substantial part of the UCR library is either inspired or inherited from the PaddleOCR library. Wherever possible the repository has been ported from PaddlePaddle to PyTorch framework including the direct translation of model parameters. Also, a big thanks to Clova AI, for open sourcing their testing script and pretrained models (CRAFT).

License

Apache License 2.0

Metadata

Release files for ucr 0.2.16

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ucr 0.2.16
File Size Uploaded
ucr-0.2.16.tar.gz 153.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ucr 0.2.16
File Interpreter ABI Platform
ucr-0.2.16-py3-none-any.whl Python 3 none any Details

Total release size: 366.7 kB

Release files / ucr-0.2.16.tar.gz

Download URL ucr-0.2.16.tar.gz
Size 153.1 kB
Tags Source
SHA-256 checksum
How to use checksums
639c538afeceabd17c197583109d31a6cb1f6a7529d8acf32899884c6b995038
BLAKE2b-256 checksum
How to use checksums
f671bdd2e235702c742d50a57dc329d2f360844759a9d2bfd5800e496392dd19
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.5 CPython/3.8.5 Linux/5.4.0-65-generic

Release files / ucr-0.2.16-py3-none-any.whl

Download URL ucr-0.2.16-py3-none-any.whl
Size 213.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f1a2df497475a57107cc128c7217ea8e1b8bb67621be2feb3b8c0ce4b19fd500
BLAKE2b-256 checksum
How to use checksums
37b11fc0afe136d83672b23de808c86d647075a18e9d18b335f29e43cdba1520
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.5 CPython/3.8.5 Linux/5.4.0-65-generic

Release history Release notifications | RSS feed

This release

0.2.16 This release

2 release files

0.2.15

2 release files

0.2.11

2 release files

0.2.10

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.14

2 release files

0.1.13

2 release files

0.1.12

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page