Skip to main content

Scene Text Detection and Recognition

This project packages scene text algorithms for easy usage. Scenes as in photos are much harder for text detection and recognition than doing the same for scanned documents. The latter is mostly referred to as OCR and it is a well solved problem. Note that due to the usage of Deep Learning algorithms, text detection and recognition are rather slow, in particular on CPU-only machines and for images with a large number of words. Accuracies have reached an impressive level but are still below human performance. Currently, the following algorithms are available.

EAST is used for detection, where the implementation is mostly copied from Jan Zdenek.

MORAN is used for recognition, where the implementation is mostly copied from Canjie Luo.

Installation:

pip install scene_text

Basic usage from Python:

import cv2

# The first import after installation can take a little longer as it downloads
# pre-trained models and compiles some native code.
from scene_text import AllWordsRecognizer

# initialize models
pipeline = AllWordsRecognizer()

# read an image
img = cv2.imread('path/to/my/image/file')[:, :, ::-1]

# detect and recognize all words in the image
words, boxes = pipeline.get_all_words(img)

Basic usage from command line:

scene_text my/input/image/folder my/output/folder

If you have trouble with the complex dependencies try Docker:

docker build -t scene_text .

docker run --rm -i -t -v ${PWD}:/scene_text scene_text

# ...

Metadata

Release files for scene-text 0.2.3

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

Source distribution (sdist)

Source distribution for scene-text 0.2.3
File Size Uploaded Provenance Actions
scene-text-0.2.3.tar.gz 184.3 kB Without provenance Details for scene-text-0.2.3.tar.gz

Release files / scene-text-0.2.3.tar.gz

Download URL scene-text-0.2.3.tar.gz
Size 184.3 kB
Tags Source
SHA-256 checksum
How to use checksums
65cd2386c0f5d6baa7136292f0f4912f66460f9cc70fc3119ecfd28e9db6f685
BLAKE2b-256 checksum
How to use checksums
15bd79bbc079c0f1006b17867507fd3969c3ec4cc977bfe386cd6d52185e0c3a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.4.2 requests/2.20.1 setuptools/40.7.3 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.6.8

Security for scene-text 0.2.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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