Creating and deploying an OCR in Python

OCR is an abbreviation for Optical Character Recognition. OCR is used for converting images of text into machine-encoded text.

It is a process of converting images of typed, handwritten, or printed text into machine-encoded text, whether from a scanned document, a photo of a document, a scene photo (for example the text on signs and billboards in a landscape photo), or from subtitle text superimposed on an image (for example from a television broadcast).

OCR is used in a variety of applications such as scanning documents, reading text in images, and converting images to text. OCR is also used in the field of document management, where it is used to convert scanned documents into machine-encoded text, which can be searched, indexed, archived, and retrieved.

In Today’s blog, we are going to create an Optical Character Recognizer and going to deploy it as an Interactive Gradio web app using TrueFoundry.

Let’s Start

Key Take Aways

  • We are going to learn about creating an OCR using EasyOCR
  • Creating an Interactive Gradio App
  • Deploying it on TrueFoundry as a Service using TrueFoundry Webapp.


  • Willingness to learn
  • Clone this repo

Installing Requirements

Creating OCR function

Here, we are using EasyOCR’s readtext method.

Creating Gradio App

Test Drive

The app will run on http://localhost:8080/

Now our code is ready, we are going to deploy it using TrueFoundry


Logging into TrueFoundry

Heading to Deployment Section

1. Creating a new deployment

2. Select the Service option and Workspace name

3. Fill out the properties and submit

4. Deploying

5. Successful Deployment

6. Final Thoughts

After the deployment will be done, you will be able to use the Gradio App.

The model is deployed here:



The above code is also present in my Repository


  1. TrueFoundry:
  2. TrueFoundry App:
  3. TrueFoundry Docs:
  4. Code:




Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store