Skip to main content

🤙🏻 Easy Paddle OCR ⚡️

Easy Paddle OCR by Theos AI

This a clean and easy-to-use implementation of Paddle OCR. Made with ❤️ by Theos AI.

Don't forget to subscribe to our YouTube Channel!

Install the package

pip install easy-paddle-ocr

How does it work?

The text recognition is made on a cropped part of a larger image, usually these crops are made with the bounding box output of an Object Detection model. You can learn how to build a license plate recogition model on the following YouTube Tutorial. You can easily train a model to make bounding boxes around any kind of text, not just license plates. After training your own object detection model, you can pass those cropped bounding boxes to Easy Paddle OCR in order to perform text recognition and read the text they contain.

Read the text

On the read.py file we recognize the text of 3 different cropped bounding boxes, each taken from larger images.

broadway.jpeg broadway.jpeg

brooklyn.jpeg brooklyn.jpeg

casino.jpeg casino.jpeg

Let's recognize all of them with the following script.

from easy_paddle_ocr import TextRecognizer
import time
import cv2

text_recognizer = TextRecognizer() # for custom weights do TextRecognizer(weights='folder_path')
images = ['broadway.jpeg', 'brooklyn.jpeg', 'casino.jpeg']

for filename in images:
  image = cv2.imread(filename)
  start = time.time()
  prediction = text_recognizer.read(image)
  print(f'\n[+] image: {filename}')
  print(f'[+] text: {prediction["text"]}')
  print(f'[+] confidence: {int(prediction["confidence"]*100)}%')
  print(f'[+] inference time: {int((time.time() - start)*1000)} milliseconds')

print()

After running the read.py script you should see the following output.

[+] image: broadway.jpeg
[+] text: BROADWAY
[+] confidence: 98%
[+] inference time: 39 milliseconds

[+] image: brooklyn.jpeg
[+] text: BROOKLYN
[+] confidence: 96%
[+] inference time: 31 milliseconds

[+] image: casino.jpeg
[+] text: CASINO
[+] confidence: 78%
[+] inference time: 30 milliseconds

Custom Training

If you find that the default Paddle OCR weights don't work very well for your specific use case, we recommed you to train your own OCR model on Theos AI.

A tutorial on how to do this is coming soon, but if you already signed up and figured out how to build your own dataset on Theos and trained it on Paddle OCR, the only thing you have to do now is download your custom weights from your training session experiment by clicking the weights button on the top right corner.

Button

Weights

Download the Last or Best weights and extract the zip file. Only the following files are required.

dictionary.txt
inference.pdiparams
inference.pdiparams.info
inference.pdmodel

Finally, set the new weights folder path when you instantiate your TextRecognizer.

text_recognizer = TextRecognizer(weights='./best')

Contact us

Reach out to contact@theos.ai if you have any questions!

Metadata

Release files for easy-paddle-ocr 0.0.5

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

Built distribution (wheel)

Table of built distributions (wheels) for easy-paddle-ocr 0.0.5
File Interpreter ABI Platform Actions
easy_paddle_ocr-0.0.5-py3-none-any.whl Python 3 none any Details for easy_paddle_ocr-0.0.5-py3-none-any.whl

Release files / easy_paddle_ocr-0.0.5-py3-none-any.whl

Download URL easy_paddle_ocr-0.0.5-py3-none-any.whl
Size 8.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
0dc6b3c26e344f3378eda531bc1cb310f44505c1c61fb69824adb24b44b7acd5
BLAKE2b-256 checksum
How to use checksums
658a44c573eda07144dc3e1984e277263ee6537a11bd552189d20c4bd9cd9a40
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.2

Security for easy-paddle-ocr 0.0.5

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