Google - Cloud Vision¶
Use the OCR features offered by Google easily through the BotCity plugin for Google Cloud Vision.
Installation¶
Importing the Plugin¶
After you installed this package, the next step is to import the package into your code and start using the functions.
As a demonstration of the library, let's build a simple example together that will parse the text from the following image:
Instantiating the Plugin¶
To make the example we will instantiate the plugin and setup our Google Cloud Vision service account key. If you don't have one yet, access this section to create one and remember to activate billing as shown in this step.
Reading text from the image¶
Now let's read the text from the image.
Complete code¶
Let's take a look into the complete code:
# Instantiate the plugin
cloudvision = BotCloudVisionPlugin()
# Setup the path to the service account key credentials JSON file
cloudvision.credentials("<path_to_my>/credentials.json")
# Read the text from the image
cloudvision.read("otter_crossing.jpg")
# Print the text from the image
print(cloudvision.full_text())